[FFmpeg-cvslog] avformat/mxfdec: check channel number in mxf_get_d10_aes3_packet()

Michael Niedermayer git at videolan.org
Sat Oct 9 19:37:01 EEST 2021


ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Sun Sep  5 21:24:15 2021 +0200| [90d2f32f621b49637474453536b0fdc4903f8cb5] | committer: Michael Niedermayer

avformat/mxfdec: check channel number in mxf_get_d10_aes3_packet()

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
Reviewed-by: Tomas Härdin <tjoppen at acc.umu.se>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 3dd5a8a13510d08a4e25e8f138d718672a0fed4a)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=90d2f32f621b49637474453536b0fdc4903f8cb5
---

 libavformat/mxfdec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index a5cdacb881..8275add38e 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -412,6 +412,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);



More information about the ffmpeg-cvslog mailing list