[FFmpeg-cvslog] wma: fix off-by-one in array bounds check.

Ronald S. Bultje git at videolan.org
Fri Mar 9 01:49:24 CET 2012


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Wed Mar  7 14:18:14 2012 -0800| [b4bccf3e4e58f6fe58043791ca09db01a4343fac] | committer: Ronald S. Bultje

wma: fix off-by-one in array bounds check.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b4bccf3e4e58f6fe58043791ca09db01a4343fac
---

 libavcodec/wmadec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 37feca1..a730059 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -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;



More information about the ffmpeg-cvslog mailing list