[FFmpeg-cvslog] wmadec: fix off by 1 error on the pow_tab index check.

Michael Niedermayer git at videolan.org
Fri Mar 2 17:12:30 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Mar  2 16:44:49 2012 +0100| [d964db5742f317ff6c6ed6cf3e168b5b38566069] | committer: Michael Niedermayer

wmadec: fix off by 1 error on the pow_tab index check.

Fixes global out of array read.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index c90e22c..7dae379 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -368,7 +368,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