[FFmpeg-cvslog] avformat/iff: Check data_size not overflowing int64

Michael Niedermayer git at videolan.org
Mon Sep 28 21:23:27 EEST 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Sep 27 22:20:52 2020 +0200| [24352ca79207d3311ee544fcba908a64004763ef] | committer: Michael Niedermayer

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 at xvid.org>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/iff.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/iff.c b/libavformat/iff.c
index 7feb121cd0..04fe8be4eb 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;



More information about the ffmpeg-cvslog mailing list