Commit d3850ac5 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '0cb83c56'

* commit '0cb83c56':
  indeo4: Check the block size if reusing the band configuration

Conflicts:
	libavcodec/indeo4.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 0c7bd340 0cb83c56
...@@ -295,6 +295,7 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band, ...@@ -295,6 +295,7 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
band->is_empty = get_bits1(&ctx->gb); band->is_empty = get_bits1(&ctx->gb);
if (!band->is_empty) { if (!band->is_empty) {
int old_blk_size = band->blk_size;
/* skip header size /* skip header size
* If header size is not given, header size is 4 bytes. */ * If header size is not given, header size is 4 bytes. */
if (get_bits1(&ctx->gb)) if (get_bits1(&ctx->gb))
...@@ -393,6 +394,13 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band, ...@@ -393,6 +394,13 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
band->quant_mat = quant_mat; 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) { 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"); av_log(avctx, AV_LOG_ERROR, "Invalid quant matrix for 4x4 block encountered!\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment