summaryrefslogtreecommitdiff
path: root/libavcodec/indeo4.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-28 14:51:21 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-03-28 14:51:21 +0200
commit92f7f1db421ee8b3431534fa09e8050ba622c33a (patch)
treeddc0eb4f7665ac589bbd23f507441c27fddd93ec /libavcodec/indeo4.c
parenta60a4d704149ab51bd27b63ae763c1d26d075013 (diff)
downloadffmpeg-92f7f1db421ee8b3431534fa09e8050ba622c33a.tar.gz
indeo4: Check for mismatching scan tables
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/indeo4.c')
-rw-r--r--libavcodec/indeo4.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index a3e2456ad0..488f97120a 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -393,6 +393,10 @@ static int decode_band_hdr(IVI4DecContext *ctx, IVIBandDesc *band,
band->is_2d_trans = transforms[transform_id].is_2d_trans;
scan_indx = get_bits(&ctx->gb, 4);
+ if ((scan_indx>4 && scan_indx<10) != (band->blk_size==4)) {
+ av_log(avctx, AV_LOG_ERROR, "mismatching scan table!\n");
+ return AVERROR_INVALIDDATA;
+ }
if (scan_indx == 15) {
av_log(avctx, AV_LOG_ERROR, "Custom scan pattern encountered!\n");
return AVERROR_INVALIDDATA;