aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-10 23:07:50 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-06 18:25:50 +0100
commit66261cfa77893cdb5b727db2a01e354ab34e933e (patch)
treee5679532dda8ba8efc35e4cf44524dd3650f01d0
parentb89b136c001b2bacab01c8778b3b1231f2a07849 (diff)
downloadffmpeg-66261cfa77893cdb5b727db2a01e354ab34e933e.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 2f6c485891..345fad87b7 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -422,6 +422,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;