diff options
author | Michael Niedermayer <[email protected]> | 2020-09-27 22:20:52 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2021-09-09 13:37:20 +0200 |
commit | c242e3efe0a512855356147c46ddc0c8cc7746f6 (patch) | |
tree | 0820f885222659dd55dcd68decade5905d7f3c4f | |
parent | 8b84fcb78f9ab25dbe1949433b58a33861118629 (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 <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 24352ca79207d3311ee544fcba908a64004763ef)
Signed-off-by: Michael Niedermayer <[email protected]>
-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 4cf17f6e1a..aa2d9dd48c 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; |