summaryrefslogtreecommitdiff
path: root/libavcodec/indeo4.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-03-21 10:39:10 -0700
committerKostya Shishkov <kostya.shishkov@gmail.com>2012-03-21 19:01:08 +0100
commit68fd077f68bdde864bb7328d72a040849c616261 (patch)
tree7b0da8a021b6fe5fc2d9870551cbf537450bc25a /libavcodec/indeo4.c
parent3b327a4b429de147ec230c65a10403443433f609 (diff)
indeo4: fix out-of-bounds function call.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
Diffstat (limited to 'libavcodec/indeo4.c')
-rw-r--r--libavcodec/indeo4.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index 573718e374..3e8a3988d6 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -372,7 +372,8 @@ static int decode_band_hdr(IVI4DecContext *ctx, IVIBandDesc *band,
if (!get_bits1(&ctx->gb) || ctx->frame_type == FRAMETYPE_INTRA) {
transform_id = get_bits(&ctx->gb, 5);
- if (!transforms[transform_id].inv_trans) {
+ if (transform_id >= FF_ARRAY_ELEMS(transforms) ||
+ !transforms[transform_id].inv_trans) {
av_log_ask_for_sample(avctx, "Unimplemented transform: %d!\n", transform_id);
return AVERROR_PATCHWELCOME;
}