]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/fic: Fail on invalid slice size/off
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 16 Dec 2018 20:43:07 +0000 (21:43 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 23 Dec 2018 19:24:47 +0000 (20:24 +0100)
Fixes: Timeout
Fixes: 11486/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5677133863583744
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/fic.c

index dcf0777674285d77ddd8e0845e9db1cb77be85a2..3e363463589cdeb0665662fd3721cbcfc21bdaef 100644 (file)
@@ -380,6 +380,8 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
             slice_h      = FFALIGN(avctx->height - ctx->slice_h * (nslices - 1), 16);
         } else {
             slice_size = AV_RB32(src + tsize + FIC_HEADER_SIZE + slice * 4 + 4);
+            if (slice_size < slice_off)
+                return AVERROR_INVALIDDATA;
         }
 
         if (slice_size < slice_off || slice_size > msize)