avcodec/indeo4: Check remaining data in Pic hdr extension parsing code
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 8 Jun 2017 11:58:47 +0000 (13:58 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 8 Jun 2017 15:37:16 +0000 (17:37 +0200)
Fixes: Timeout
Fixes: 2115/clusterfuzz-testcase-minimized-6594111748440064

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/indeo4.c

index 594c56d..85d5fa3 100644 (file)
@@ -237,6 +237,8 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
     /* skip picture header extension if any */
     while (get_bits1(&ctx->gb)) {
         ff_dlog(avctx, "Pic hdr extension encountered!\n");
+        if (get_bits_left(&ctx->gb) < 10)
+            return AVERROR_INVALIDDATA;
         skip_bits(&ctx->gb, 8);
     }