aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/wmadec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-02 16:44:49 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-02 16:44:49 +0100
commitd964db5742f317ff6c6ed6cf3e168b5b38566069 (patch)
tree6bd29986dbbae0d7d9aeaef28044be58bc523702 /libavcodec/wmadec.c
parenta5bf9b351cc0db2b95cc199e30f2ec7325009c3a (diff)
downloadffmpeg-d964db5742f317ff6c6ed6cf3e168b5b38566069.tar.gz
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@gmx.at>
Diffstat (limited to 'libavcodec/wmadec.c')
-rw-r--r--libavcodec/wmadec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index c90e22ca8e..7dae379ba8 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;