Browse Source

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 5473c7825e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.1.5
Michael Niedermayer 6 years ago
parent
commit
2b5abf94de
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/wmaprodec.c

+ 5
- 0
libavcodec/wmaprodec.c View File

@@ -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], ret = decode_packet(avctx, &s->xma[s->current_stream], s->frames[s->current_stream],
&got_stream_frame_ptr, avpkt); &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) */ /* copy stream samples (1/2ch) to sample buffer (Nch) */
if (got_stream_frame_ptr) { if (got_stream_frame_ptr) {
int start_ch = s->start_channel[s->current_stream]; int start_ch = s->start_channel[s->current_stream];


Loading…
Cancel
Save