diff options
-rw-r--r-- | libavcodec/indeo4.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index 45ff6197c5..6615b63ce2 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -420,7 +420,11 @@ static int decode_band_hdr(IVI4DecContext *ctx, IVIBandDesc *band, } band->quant_mat = quant_mat; } - + if (quant_index_to_tab[band->quant_mat] > 4 && band->blk_size == 4) { + av_log(avctx, AV_LOG_ERROR, "Invalid quant matrix for 4x4 block encountered!\n"); + band->quant_mat = 0; + return AVERROR_INVALIDDATA; + } /* decode block huffman codebook */ if (ff_ivi_dec_huff_desc(&ctx->gb, get_bits1(&ctx->gb), IVI_BLK_HUFF, &band->blk_vlc, avctx)) |