From: Michael Niedermayer Date: Sun, 13 Oct 2013 08:19:15 +0000 (+0200) Subject: Merge commit '0cb83c563848bf8f8365e7bd30e7e6b57ef360f0' X-Git-Tag: android-x86-4.4-r1~635 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d3850ac5b9c7e0f6cd77d652a3a8985c6ca6732a;p=android-x86%2Fexternal-ffmpeg.git Merge commit '0cb83c563848bf8f8365e7bd30e7e6b57ef360f0' * commit '0cb83c563848bf8f8365e7bd30e7e6b57ef360f0': indeo4: Check the block size if reusing the band configuration Conflicts: libavcodec/indeo4.c Merged-by: Michael Niedermayer --- d3850ac5b9c7e0f6cd77d652a3a8985c6ca6732a diff --cc libavcodec/indeo4.c index 65aa4f5c40,3c749a9b8b..0774f82ce5 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@@ -387,26 -374,19 +388,33 @@@ static int decode_band_hdr(IVI45DecCont av_log(avctx, AV_LOG_ERROR, "Custom quant matrix encountered!\n"); return AVERROR_INVALIDDATA; } - if (band->quant_mat >= FF_ARRAY_ELEMS(quant_index_to_tab)) { + if (quant_mat >= FF_ARRAY_ELEMS(quant_index_to_tab)) { avpriv_request_sample(avctx, "Quantization matrix %d", - band->quant_mat); + quant_mat); return AVERROR_INVALIDDATA; } + band->quant_mat = quant_mat; + } else { + if (old_blk_size != band->blk_size) { + av_log(avctx, AV_LOG_ERROR, + "The band block size does not match the configuration " + "inherited\n"); + return AVERROR_INVALIDDATA; + } } + 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; + } + if (band->scan_size != band->blk_size) { + av_log(avctx, AV_LOG_ERROR, "mismatching scan table!\n"); + return AVERROR_INVALIDDATA; + } + if (band->transform_size == 8 && band->blk_size < 8) { + av_log(avctx, AV_LOG_ERROR, "mismatching transform_size!\n"); + return AVERROR_INVALIDDATA; + } /* decode block huffman codebook */ if (!get_bits1(&ctx->gb))