]> git.sesse.net Git - ffmpeg/commitdiff
avformat/mov: Check if hoov is at the end
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 25 Oct 2020 17:39:45 +0000 (18:39 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 19 Dec 2020 19:07:56 +0000 (20:07 +0100)
Fixes: Timeout, probably infinite loop
Fixes: 26559/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5391165484171264
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mov.c

index 710a15dea897348c5ac783eeb73c8d5ef11d0c62..c6a2d9c388d6d3a1b0459649494a88cc74e502b8 100644 (file)
@@ -7006,6 +7006,8 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
                 uint32_t type;
                 avio_skip(pb, 4);
                 type = avio_rl32(pb);
+                if (avio_feof(pb))
+                    break;
                 avio_seek(pb, -8, SEEK_CUR);
                 if (type == MKTAG('m','v','h','d') ||
                     type == MKTAG('c','m','o','v')) {