diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index 0065b52c75..1bf402551b 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -246,6 +246,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); }