summaryrefslogtreecommitdiff
path: root/libavcodec/indeo4.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-14 13:37:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-14 13:37:40 +0200
commita8e5fac1fb3fddeea829648139aa345af9cdc16c (patch)
tree46a212be2aa790088f37b483ebe5096e8f729b2d /libavcodec/indeo4.c
parentccb422a69728ac739b20ba2c67d49d265fd20fdb (diff)
parentdc79685195a45c9b8b17d7b93d118e0aefa45462 (diff)
downloadffmpeg-a8e5fac1fb3fddeea829648139aa345af9cdc16c.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: indeo: Bound-check before applying transform Conflicts: libavcodec/indeo4.c libavcodec/indeo5.c libavcodec/ivi_common.c See: af388237093ed6df6f5118b34ef938a2ca2ffbda, 0846719dd11ab3f7a7caee13e7af71f71d913389 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/indeo4.c')
-rw-r--r--libavcodec/indeo4.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index c35ca33fc3..474140e641 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -352,7 +352,14 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
band->inv_transform = transforms[transform_id].inv_trans;
band->dc_transform = transforms[transform_id].dc_trans;
band->is_2d_trans = transforms[transform_id].is_2d_trans;
- band->transform_size= (transform_id < 10) ? 8 : 4;
+
+ if (transform_id < 10)
+ band->transform_size = 8;
+ else
+ band->transform_size = 4;
+
+ if (band->blk_size != band->transform_size)
+ return AVERROR_INVALIDDATA;
scan_indx = get_bits(&ctx->gb, 4);
if (scan_indx == 15) {