aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-11-12 20:06:35 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-06 15:03:15 +0100
commit2b5abf94de1741bcd1ed68bbd3fd674398a43f3f (patch)
tree6b0aabc8196a65203b92483c1645b0dc173921df
parentb26f303865f3edd0055386d2b5c6a96d8eec8a37 (diff)
downloadffmpeg-2b5abf94de1741bcd1ed68bbd3fd674398a43f3f.tar.gz
avcodec/wmaprodec: Check offset
Fixes: index 33280 out of bounds for type 'float [32768]' Fixes: 18718/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA2_fuzzer-5635373899710464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 5473c7825ea627a115155313a56a907d67a0d0c1) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wmaprodec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index c8ae9608ff..71d8c24658 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1775,6 +1775,11 @@ static int xma_decode_packet(AVCodecContext *avctx, void *data,
ret = decode_packet(avctx, &s->xma[s->current_stream], s->frames[s->current_stream],
&got_stream_frame_ptr, avpkt);
+ if (got_stream_frame_ptr && s->offset[s->current_stream] >= 64) {
+ got_stream_frame_ptr = 0;
+ ret = AVERROR_INVALIDDATA;
+ }
+
/* copy stream samples (1/2ch) to sample buffer (Nch) */
if (got_stream_frame_ptr) {
int start_ch = s->start_channel[s->current_stream];