[FFmpeg-cvslog] avformat/vividas: Fix another infinite loop

Michael Niedermayer git at videolan.org
Wed Sep 4 22:25:57 EEST 2019


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sat Aug 10 23:09:47 2019 +0200| [4d7bbeb16405aba833a582b8d57b88671f3844b8] | committer: Michael Niedermayer

avformat/vividas: Fix another infinite loop

Not found by the fuzzer

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 1d72b5d2d5225dde0662a1f2083a27f86a8fdb98)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4d7bbeb16405aba833a582b8d57b88671f3844b8
---

 libavformat/vividas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index a5f33181de..0c33ca2da8 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -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);



More information about the ffmpeg-cvslog mailing list