Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] cbs_vp9: Ensure that the two superframe_header instances are identical
Date: Mon, 12 Aug 2024 21:43:50 +0200
Message-ID: <20240812194350.GN4991@pb2> (raw)
In-Reply-To: <011aa19c-d4dd-4dec-b7e6-3243187a215f@jkqxz.net>


[-- Attachment #1.1: Type: text/plain, Size: 3466 bytes --]

On Sun, Aug 11, 2024 at 07:17:25PM +0100, Mark Thompson wrote:
> Fixes: use of uninitialized value
> Fixes: 70907/clusterfuzz-testcase-minimized-ffmpeg_BSF_VP9_METADATA_fuzzer-6339363208757248
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> ---
> On 11/08/2024 19:05, Mark Thompson wrote:
> > The correct fix therefore would be to constrain the second read values to be identical to the first, not to introduce new syntax elements not in the standard to cover the invalid case.
> 
> Like this.  (Marked in the same way as your suggested patch based on my assumption that it fixes the problem - please check.)
> 
> Trace output is correct in the normal case, and catches the error in the bad one:
> 
> [trace_headers @ 0x55a0f5decb40] Packet: 11971 bytes, pts 366, dts 366.
> [trace_headers @ 0x55a0f5decb40] Superframe Index
> [trace_headers @ 0x55a0f5decb40] 0           superframe_marker                                         110 = 6
> [trace_headers @ 0x55a0f5decb40] 3           bytes_per_framesize_minus_1                                01 = 1
> [trace_headers @ 0x55a0f5decb40] 5           frames_in_superframe_minus_1                              001 = 1
> [trace_headers @ 0x55a0f5decb40] 8           frame_sizes[0]                               1011110000101110 = 11964
> [trace_headers @ 0x55a0f5decb40] 24          frame_sizes[1]                               0000000100000000 = 1
> [trace_headers @ 0x55a0f5decb40] 40          superframe_marker                                         110 = 6
> [trace_headers @ 0x55a0f5decb40] 43          bytes_per_framesize_minus_1                                01 = 1
> [trace_headers @ 0x55a0f5decb40] 45          frames_in_superframe_minus_1                              001 = 1
> 
> or
> 
> [trace_headers @ 0x555af04d7b40] Packet: 11971 bytes, pts 366, dts 366.
> [trace_headers @ 0x555af04d7b40] Superframe Index
> [trace_headers @ 0x555af04d7b40] 0           superframe_marker                                         110 = 6
> [trace_headers @ 0x555af04d7b40] 3           bytes_per_framesize_minus_1                                01 = 1
> [trace_headers @ 0x555af04d7b40] 5           frames_in_superframe_minus_1                              001 = 1
> [trace_headers @ 0x555af04d7b40] 8           frame_sizes[0]                               1011110000101110 = 11964
> [trace_headers @ 0x555af04d7b40] 24          frame_sizes[1]                               0000000100000000 = 1
> [trace_headers @ 0x555af04d7b40] 40          superframe_marker                                         110 = 6
> [trace_headers @ 0x555af04d7b40] 43          bytes_per_framesize_minus_1                                10 = 2
> [trace_headers @ 0x555af04d7b40] bytes_per_framesize_minus_1 out of range: 2, but must be in [1,1].
> [vost#0:0/copy @ 0x555af0538400] Error applying bitstream filters to a packet: Invalid data found when processing input
> 
> Thanks,
> 
> - Mark
> 
>  libavcodec/cbs_vp9_syntax_template.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)

If its intended that this will discard cases where they differ
then your patch is probably ok

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      reply	other threads:[~2024-08-12 19:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07 23:53 [FFmpeg-devel] [PATCH 1/2] avcodec/cfhdenc: Clear dwt_tmp Michael Niedermayer
2024-08-07 23:53 ` [FFmpeg-devel] [PATCH 2/2] avcodec/cbs_vp9: Try to store fewer than 2 things in the same bit Michael Niedermayer
2024-08-11 18:05   ` Mark Thompson
2024-08-11 18:17     ` [FFmpeg-devel] [PATCH] cbs_vp9: Ensure that the two superframe_header instances are identical Mark Thompson
2024-08-12 19:43       ` Michael Niedermayer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240812194350.GN4991@pb2 \
    --to=michael@niedermayer.cc \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git