diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-10 23:07:50 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-28 18:53:11 +0100 |
commit | d3e19509cf4350063711d7cdb069c11f2423d8a1 (patch) | |
tree | 01859cf014768cf964dbc25fc5c06d7cfcaf6780 /libavcodec | |
parent | 58e673b9a3457bcffae39b3f90c7d9a20f29d68d (diff) | |
download | ffmpeg-d3e19509cf4350063711d7cdb069c11f2423d8a1.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>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/wmaprodec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index d57c24dddf..19f5566e8d 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -420,6 +420,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; |