summaryrefslogtreecommitdiff
path: root/libavcodec/wmaprodec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-10-04 19:30:15 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-05 20:06:42 +0200
commit07e46690532a21faf29938e7a06f452a780f0361 (patch)
treebb7f916f5203f2909d3499621c90d8b4fc26ffa3 /libavcodec/wmaprodec.c
parent31a373ce71a10f50a603149e4201280996ff7ed1 (diff)
downloadffmpeg-07e46690532a21faf29938e7a06f452a780f0361.tar.gz
avcodec/wmaprodec: Do not initialize unused variable to out of array value
Fixes: out of array read Fixes: 39452/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA2_fuzzer-4678745030524928.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r--libavcodec/wmaprodec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 7b489943f4..ba7bddc51c 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1932,11 +1932,12 @@ static int xma_decode_packet(AVCodecContext *avctx, void *data,
for (i = 0; i < s->num_streams; i++) {
const int start_ch = s->start_channel[i];
void *left[1] = { frame->extended_data[start_ch + 0] };
- void *right[1] = { frame->extended_data[start_ch + 1] };
av_audio_fifo_read(s->samples[0][i], left, nb_samples);
- if (s->xma[i].nb_channels > 1)
+ if (s->xma[i].nb_channels > 1) {
+ void *right[1] = { frame->extended_data[start_ch + 1] };
av_audio_fifo_read(s->samples[1][i], right, nb_samples);
+ }
}
*got_frame_ptr = nb_samples > 0;