diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-09-27 23:20:52 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-10 17:04:26 +0300 |
commit | 5bc8eae840a5127117bd971f8800874d1c2a8722 (patch) | |
tree | 71487967ca0a585c2d6adfe069f7f7f0c0ca5ec1 /libavformat/iff.c | |
parent | f38d86df9d82bbe785daa128e1116b68b20d479f (diff) |
avformat/iff: Check data_size not overflowing int64
Fixes: Infinite loop
Fixes: 25844/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5660803318153216
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 24352ca79207d3311ee544fcba908a64004763ef)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/iff.c')
-rw-r--r-- | libavformat/iff.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c index f4d806b7b8..add8912686 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -449,6 +449,9 @@ static int iff_read_header(AVFormatContext *s) data_size = iff->is_64bit ? avio_rb64(pb) : avio_rb32(pb); orig_pos = avio_tell(pb); + if (data_size >= INT64_MAX) + return AVERROR_INVALIDDATA; + switch(chunk_id) { case ID_VHDR: st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; |