summaryrefslogtreecommitdiff
path: root/libavcodec/indeo4.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-10-11 10:51:53 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-10-13 01:38:20 +0200
commit0cb83c563848bf8f8365e7bd30e7e6b57ef360f0 (patch)
treeda8edbfdbd01a670e6e1cea61d304751a2b4305d /libavcodec/indeo4.c
parentfd2384f02b905a106fba9222ece4ddbe2ec61937 (diff)
downloadffmpeg-0cb83c563848bf8f8365e7bd30e7e6b57ef360f0.tar.gz
indeo4: Check the block size if reusing the band configuration
Sample-Id: 00000287-google Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/indeo4.c')
-rw-r--r--libavcodec/indeo4.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index 042529f894..3c749a9b8b 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -293,6 +293,7 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
band->is_empty = get_bits1(&ctx->gb);
if (!band->is_empty) {
+ int old_blk_size = band->blk_size;
/* skip header size
* If header size is not given, header size is 4 bytes. */
if (get_bits1(&ctx->gb))
@@ -378,6 +379,13 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
band->quant_mat);
return AVERROR_INVALIDDATA;
}
+ } 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;
+ }
}
/* decode block huffman codebook */