diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-05 21:24:15 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-17 21:34:53 +0200 |
commit | c8174013f2205acf8367392596c75d76d6405271 (patch) | |
tree | 1a0f60efed1ff9b70fe6f22927efd25d21a91b65 /libavformat | |
parent | ea7b135a1bcc544cba539efd51ad3779ee487b1e (diff) | |
download | ffmpeg-c8174013f2205acf8367392596c75d76d6405271.tar.gz |
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@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3dd5a8a13510d08a4e25e8f138d718672a0fed4a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mxfdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 97da75fcec..f3e9556005 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -403,6 +403,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->codec->channels > 8) + return AVERROR_INVALIDDATA; + for (; end_ptr - buf_ptr >= st->codec->channels * 4; ) { for (i = 0; i < st->codec->channels; i++) { uint32_t sample = bytestream_get_le32(&buf_ptr); |