]> git.sesse.net Git - ffmpeg/commitdiff
avformat/vividas: Check for EOF in first loop in track_header()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 20 Sep 2020 19:09:31 +0000 (21:09 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 21 Sep 2020 09:55:35 +0000 (11:55 +0200)
Fixes: timeout (243sec -> a few ms)
Fixes: 25716/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5764093666131968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/vividas.c

index 36c007b0d269b115b27205906f1c5d8f370439f9..7917df5d64f6bf01ad58909b87255abe53c31475 100644 (file)
@@ -293,6 +293,8 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s,  uint8_t *
 
     for (i=0;i<val_1;i++) {
         int c = avio_r8(pb);
+        if (avio_feof(pb))
+            return AVERROR_EOF;
         for (j=0;j<c;j++) {
             if (avio_feof(pb))
                 return AVERROR_EOF;