avformat/vividas: Fix another infinite loop
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 10 Aug 2019 21:09:47 +0000 (23:09 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 11 Aug 2019 17:13:21 +0000 (19:13 +0200)
Not found by the fuzzer

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/vividas.c

index a5f3318..0c33ca2 100644 (file)
@@ -546,7 +546,7 @@ static int viv_read_header(AVFormatContext *s)
             break;
 
         block_len = ffio_read_varlen(pb);
-        if (avio_feof(pb))
+        if (avio_feof(pb) || block_len <= 0)
             return AVERROR_INVALIDDATA;
 
         block_type = avio_r8(pb);