Message ID | 20210905192418.25970-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | 3dd5a8a13510d08a4e25e8f138d718672a0fed4a |
Headers | show |
Series | [FFmpeg-devel,1/4] avformat/mxfdec: check channel number in mxf_get_d10_aes3_packet() | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
andriy/make_ppc | success | Make finished |
andriy/make_fate_ppc | success | Make fate finished |
sön 2021-09-05 klockan 21:24 +0200 skrev Michael Niedermayer: > Fixes: Out of array access > Fixes: 37030/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer- > 5387719147651072 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavformat/mxfdec.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c > index 55f2e5c767..ebe411b04d 100644 > --- a/libavformat/mxfdec.c > +++ b/libavformat/mxfdec.c > @@ -552,6 +552,10 @@ static int mxf_get_d10_aes3_packet(AVIOContext > *pb, AVStream *st, AVPacket *pkt, > data_ptr = pkt->data; > end_ptr = pkt->data + length; > buf_ptr = pkt->data + 4; /* skip SMPTE 331M header */ > + > + if (st->codecpar->channels > 8) > + return AVERROR_INVALIDDATA; Looks fine. Double-checked S331m, AES is limited to 8 channels /Tomas
On Sun, Sep 12, 2021 at 02:58:52PM +0200, Tomas Härdin wrote: > sön 2021-09-05 klockan 21:24 +0200 skrev Michael Niedermayer: > > Fixes: Out of array access > > Fixes: 37030/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer- > > 5387719147651072 > > > > Found-by: continuous fuzzing process > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > > --- > > libavformat/mxfdec.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c > > index 55f2e5c767..ebe411b04d 100644 > > --- a/libavformat/mxfdec.c > > +++ b/libavformat/mxfdec.c > > @@ -552,6 +552,10 @@ static int mxf_get_d10_aes3_packet(AVIOContext > > *pb, AVStream *st, AVPacket *pkt, > > data_ptr = pkt->data; > > end_ptr = pkt->data + length; > > buf_ptr = pkt->data + 4; /* skip SMPTE 331M header */ > > + > > + if (st->codecpar->channels > 8) > > + return AVERROR_INVALIDDATA; > > Looks fine. Double-checked S331m, AES is limited to 8 channels will apply thx [...]
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 55f2e5c767..ebe411b04d 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -552,6 +552,10 @@ static int mxf_get_d10_aes3_packet(AVIOContext *pb, AVStream *st, AVPacket *pkt, data_ptr = pkt->data; end_ptr = pkt->data + length; buf_ptr = pkt->data + 4; /* skip SMPTE 331M header */ + + if (st->codecpar->channels > 8) + return AVERROR_INVALIDDATA; + for (; end_ptr - buf_ptr >= st->codecpar->channels * 4; ) { for (i = 0; i < st->codecpar->channels; i++) { uint32_t sample = bytestream_get_le32(&buf_ptr);
Fixes: Out of array access Fixes: 37030/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5387719147651072 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/mxfdec.c | 4 ++++ 1 file changed, 4 insertions(+)