[FFmpeg-devel] [PATCH 2/9] avformat/mov: Limit nb_chapter_tracks to input size

Michael Niedermayer michael at niedermayer.cc
Mon Apr 19 21:23:39 EEST 2021


Fixes: Timeout (15k loop iterations instead of 400m)
Fixes: 31368/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6601583174483968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9ca1ac89a8..add1e94641 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4687,6 +4687,8 @@ static int mov_read_chap(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     for (i = 0; i < num && !pb->eof_reached; i++)
         c->chapter_tracks[i] = avio_rb32(pb);
 
+    c->nb_chapter_tracks = i;
+
     return 0;
 }
 
-- 
2.17.1



More information about the ffmpeg-devel mailing list