[FFmpeg-cvslog] avformat/mov: Limit nb_chapter_tracks to input size

Michael Niedermayer git at videolan.org
Fri Jun 18 22:14:12 EEST 2021


ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Mon Apr 19 13:30:17 2021 +0200| [409c33e5f882c7b9013ff7f4e1d1cdd831c65095] | committer: Michael Niedermayer

avformat/mov: Limit nb_chapter_tracks to input size

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>
(cherry picked from commit 299a56c9006b2eb8807c3e3efefb91a78fe6b3b2)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index cd56df5b29..e6c2dca0ba 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4700,6 +4700,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;
 }
 



More information about the ffmpeg-cvslog mailing list