]> git.sesse.net Git - ffmpeg/commitdiff
avformat/au: Check for EOF in au_read_annotation()
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 15 Oct 2020 20:19:32 +0000 (22:19 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 23 Oct 2020 08:07:57 +0000 (10:07 +0200)
Fixes: Timeout (too looong -> 1 ms)
Fixes: 26366/clusterfuzz-testcase-minimized-ffmpeg_dem_SDX_fuzzer-5655584843759616
Fixes: 26391/clusterfuzz-testcase-minimized-ffmpeg_dem_ALP_fuzzer-5484026133217280
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/au.c

index c09f4da4c9670a9619192c0ccdec0bab1bad1980..b4eb4f8477ae5faba3d2e7e830c55aed63aed2ba 100644 (file)
@@ -84,6 +84,8 @@ static int au_read_annotation(AVFormatContext *s, int size)
     av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED);
 
     while (size-- > 0) {
+        if (avio_feof(pb))
+            return AVERROR_EOF;
         c = avio_r8(pb);
         switch(state) {
         case PARSE_KEY: