OSDN Git Service

indeo4: fix out-of-bounds function call.
authorRonald S. Bultje <rsbultje@gmail.com>
Wed, 21 Mar 2012 17:39:10 +0000 (10:39 -0700)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 21 Mar 2012 18:01:08 +0000 (19:01 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
libavcodec/indeo4.c

index 573718e..3e8a398 100644 (file)
@@ -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;
             }