[FFmpeg-cvslog] avformat/mov: Check for EOF in mov_read_iloc()

Michael Niedermayer git at videolan.org
Thu Jul 21 22:08:00 EEST 2022


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Jul 20 01:05:20 2022 +0200| [744ad45c44e69e354e924902c4daf0044dcd9955] | committer: Michael Niedermayer

avformat/mov: Check for EOF in mov_read_iloc()

Fixes: Timeout
Fixes: 49216/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6563000529584128

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 14550e6456..a09a762d91 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7555,6 +7555,8 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     for (int i = 0; i < item_count; i++) {
         int item_id = (version < 2) ? avio_rb16(pb) : avio_rb32(pb);
+        if (avio_feof(pb))
+            return AVERROR_INVALIDDATA;
         if (version > 0)
             avio_rb16(pb);  // construction_method.
         avio_rb16(pb);  // data_reference_index.



More information about the ffmpeg-cvslog mailing list