[FFmpeg-cvslog] avformat/ifv: Check for EOF in read_index()

Michael Niedermayer git at videolan.org
Fri Jul 19 11:22:22 EEST 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Jul 18 01:00:11 2019 +0200| [00ed04d6149691a9abf486b2f88172fd6341d801] | committer: Michael Niedermayer

avformat/ifv: Check for EOF in read_index()

Fixes: Timeout
Fixes: 15567/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5758451487080448

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=00ed04d6149691a9abf486b2f88172fd6341d801
---

 libavformat/ifv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/ifv.c b/libavformat/ifv.c
index 6acbb29a75..f95e9b0e52 100644
--- a/libavformat/ifv.c
+++ b/libavformat/ifv.c
@@ -68,6 +68,8 @@ static int read_index(AVFormatContext *s,
     }
 
     for (i = start_index; i < end_index; i++) {
+        if (avio_feof(s->pb))
+            return AVERROR_EOF;
         pos = avio_rl32(s->pb);
         size = avio_rl32(s->pb);
 



More information about the ffmpeg-cvslog mailing list