]> git.sesse.net Git - ffmpeg/commitdiff
avformat/argo_brp: bail if no video frames
authorZane van Iperen <zane@zanevaniperen.com>
Mon, 2 Nov 2020 11:57:19 +0000 (21:57 +1000)
committerZane van Iperen <zane@zanevaniperen.com>
Tue, 3 Nov 2020 00:47:37 +0000 (10:47 +1000)
Fixes: Assertion failure
Fixes: 26572/clusterfuzz-testcase-minimized-ffmpeg_dem_ARGO_BRP_fuzzer-5166735591997440
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
libavformat/argo_brp.c

index fdc552af1408fb269334252363e3f466398d60c1..766d4fd2617964bcc79cba19addab8dde98a8cd1 100644 (file)
@@ -218,6 +218,9 @@ static int argo_brp_read_header(AVFormatContext *s)
             bvid->height     = AV_RL32(buf +  8);
             bvid->depth      = AV_RL32(buf + 12);
 
+            if (bvid->num_frames == 0)
+                return AVERROR_INVALIDDATA;
+
             /* These are from 1990's games, sanity check this. */
             if (bvid->width >= 65536 || bvid->height >= 65536 ||
                 bvid->depth > 24     || bvid->depth % 8 != 0) {