]> git.sesse.net Git - ffmpeg/commitdiff
avformat/dhav: Break out of infinite dhav search loop
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 9 Nov 2020 19:42:56 +0000 (20:42 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 21 Jan 2021 19:21:32 +0000 (20:21 +0100)
Fixes: Infinite loop
Fixes: 26922/clusterfuzz-testcase-minimized-ffmpeg_dem_DHAV_fuzzer-5794549613723648
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/dhav.c

index 6a6c235e655fff9c5474049637c783e10184aaa6..526331ae4cc1931cc3d975c7eecfa4855c3211f8 100644 (file)
@@ -281,6 +281,8 @@ static int dhav_read_header(AVFormatContext *s)
                 int seek_back;
 
                 seek_back = avio_rl32(s->pb) + 8;
+                if (seek_back < 9)
+                    break;
                 dhav->last_good_pos = avio_tell(s->pb);
                 avio_seek(s->pb, -seek_back, SEEK_CUR);
             }