aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-10 23:07:50 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-12 00:47:05 +0100
commitf78f7eca1a5ce67db6b1f8a159dc47cc57e8d43a (patch)
tree7146c74ea7c69c1ac71938bf1fa8145e5db4fa2a
parentf3cdeeb070d4793d98b16a7ad66049e537ab7ba7 (diff)
downloadffmpeg-f78f7eca1a5ce67db6b1f8a159dc47cc57e8d43a.tar.gz
avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization
Fixes out of array read Fixes: asan_heap-oob_2aec5b0_1828_classical_22_16_2_16000_v3c_0_exclusive_0_29.wma Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 5dcb99033df16eccc4dbbc4a099ad64457f9f090) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/wmaprodec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 816d95ffc0..67c62a4da0 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -404,6 +404,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
offset &= ~3;
if (offset > s->sfb_offsets[i][band - 1])
s->sfb_offsets[i][band++] = offset;
+
+ if (offset >= subframe_len)
+ break;
}
s->sfb_offsets[i][band - 1] = subframe_len;
s->num_sfb[i] = band - 1;