From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/4] avcodec/vp9_superframe_split_bsf: Check in size
Date: Mon, 21 Mar 2022 19:59:21 +0100
Message-ID: <20220321185921.GL2829255@pb2> (raw)
In-Reply-To: <a3ea1212-c123-10d6-5954-0ce8cc2af281@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2139 bytes --]
On Sun, Mar 13, 2022 at 04:03:42PM -0300, James Almer wrote:
>
>
> On 3/12/2022 8:52 PM, Michael Niedermayer wrote:
> > Fixes: Out of array read
> > Fixes: 45137/clusterfuzz-testcase-minimized-ffmpeg_BSF_VP9_SUPERFRAME_SPLIT_fuzzer-4984270639202304
> >
> > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> > libavcodec/vp9_superframe_split_bsf.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/libavcodec/vp9_superframe_split_bsf.c b/libavcodec/vp9_superframe_split_bsf.c
> > index ed0444561a..6af555c078 100644
> > --- a/libavcodec/vp9_superframe_split_bsf.c
> > +++ b/libavcodec/vp9_superframe_split_bsf.c
> > @@ -51,6 +51,11 @@ static int vp9_superframe_split_filter(AVBSFContext *ctx, AVPacket *out)
> > return ret;
> > in = s->buffer_pkt;
> > + if (in->size == 0) {
>
> !in->size
>
> > + ret = AVERROR_INVALIDDATA;
> > + goto fail;
> > + }
> > +
> > marker = in->data[in->size - 1];
>
> Do we want to abort on in->data && !in->size, or just pass the packet
> through?
> I'm partial to the latter, so it would mean initializing marker to 0 and
> check instead for in->size before setting marker, so the check below fails
> and the packet is just passed through.
>
> Not sure what others think about it.
I have no opinion on this. I just want the bug fixed. As both andreas
and ossfuzz noticed this affects other filters too.
not sure the passthough makes sense for all them, i will just dumbly
post a passthrough based patch for the other one ossfuzz found too
but maybe erroring out as in andreas patch makes more sense
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The real ebay dictionary, page 1
"Used only once" - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
[-- 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".
prev parent reply other threads:[~2022-03-21 18:59 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-12 23:52 Michael Niedermayer
2022-03-12 23:52 ` [FFmpeg-devel] [PATCH 2/4] avformat/mxfdec: Check count in mxf_read_strong_ref_array() Michael Niedermayer
2022-03-14 19:19 ` Tomas Härdin
2022-03-19 22:50 ` Michael Niedermayer
2022-03-20 13:05 ` Tomas Härdin
2022-03-20 14:06 ` Michael Niedermayer
2022-03-21 10:06 ` Tomas Härdin
2022-03-21 21:20 ` Michael Niedermayer
2022-03-12 23:52 ` [FFmpeg-devel] [PATCH 3/4] avformat/mxfdec: Check for avio_read() failure " Michael Niedermayer
2022-03-13 15:52 ` Marton Balint
2022-03-14 13:58 ` Michael Niedermayer
2022-03-14 17:08 ` Marton Balint
2022-03-15 12:48 ` Michael Niedermayer
2022-03-14 19:21 ` Tomas Härdin
2022-03-19 22:54 ` Michael Niedermayer
2022-03-12 23:52 ` [FFmpeg-devel] [PATCH 4/4] avformat/mxfdec: Do not clear array in mxf_read_strong_ref_array() before writing Michael Niedermayer
2022-03-13 15:53 ` Marton Balint
2022-03-14 13:59 ` Michael Niedermayer
2022-03-13 19:03 ` [FFmpeg-devel] [PATCH 1/4] avcodec/vp9_superframe_split_bsf: Check in size James Almer
2022-03-14 14:04 ` Michael Niedermayer
2022-03-14 14:07 ` James Almer
2022-03-14 14:16 ` Michael Niedermayer
2022-03-21 18:59 ` 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=20220321185921.GL2829255@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