[FFmpeg-cvslog] avformat/vividas: Check for zero v_size

Michael Niedermayer git at videolan.org
Fri Oct 23 11:34:31 EEST 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Oct 22 00:37:30 2020 +0200| [c7a5face77878ef0169a56a46d4320a41d52d3b5] | committer: Michael Niedermayer

avformat/vividas: Check for zero v_size

Fixes: SEGV on unknown address 0x000000000000
Fixes: 26482/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-4905102324006912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/vividas.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index 4b2801ef34..7d59cd8fe9 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -679,7 +679,7 @@ static int viv_read_packet(AVFormatContext *s,
             return AVERROR_INVALIDDATA;
 
         ffio_read_varlen(pb);
-        if (v_size > INT_MAX)
+        if (v_size > INT_MAX || !v_size)
             return AVERROR_INVALIDDATA;
         ret = av_get_packet(pb, pkt, v_size);
         if (ret < 0)
@@ -708,7 +708,7 @@ static int viv_read_packet(AVFormatContext *s,
     } else {
         uint64_t v_size = ffio_read_varlen(pb);
 
-        if (v_size > INT_MAX)
+        if (v_size > INT_MAX || !v_size)
             return AVERROR_INVALIDDATA;
         ret = av_get_packet(pb, pkt, v_size);
         if (ret < 0)



More information about the ffmpeg-cvslog mailing list