diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-12 20:06:35 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-31 19:51:57 +0100 |
commit | 50ed50a03b0992ee85ae0b64165565d0983ad290 (patch) | |
tree | f41c6eb3a0eeaac54497d891a3dfa90eab22b9f7 /libavcodec | |
parent | 6bb2004c827adadffe549599d2508574cfd47e86 (diff) | |
download | ffmpeg-50ed50a03b0992ee85ae0b64165565d0983ad290.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>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/wmaprodec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 6a22e2f552..775f17381f 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -1803,6 +1803,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]; |