wma: fix off-by-one in array bounds check.
authorRonald S. Bultje <rsbultje@gmail.com>
Wed, 7 Mar 2012 22:18:14 +0000 (14:18 -0800)
committerRonald S. Bultje <rsbultje@gmail.com>
Wed, 7 Mar 2012 22:42:39 +0000 (14:42 -0800)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
libavcodec/wmadec.c

index 37feca1..a730059 100644 (file)
@@ -356,7 +356,7 @@ static int decode_exp_vlc(WMACodecContext *s, int ch)
         }
         /* NOTE: this offset is the same as MPEG4 AAC ! */
         last_exp += code - 60;
-        if ((unsigned)last_exp + 60 > FF_ARRAY_ELEMS(pow_tab)) {
+        if ((unsigned)last_exp + 60 >= FF_ARRAY_ELEMS(pow_tab)) {
             av_log(s->avctx, AV_LOG_ERROR, "Exponent out of range: %d\n",
                    last_exp);
             return -1;