diff --git a/libavcodec/fic.c b/libavcodec/fic.c index 8c4c4814db..d94b1dba64 100644 --- a/libavcodec/fic.c +++ b/libavcodec/fic.c @@ -138,6 +138,9 @@ static int fic_decode_block(FICContext *ctx, GetBitContext *gb, { int i, num_coeff; + if (get_bits_left(gb) < 8) + return AVERROR_INVALIDDATA; + /* Is it a skip block? */ if (get_bits1(gb)) { /* This is a P-frame. */