mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
31a373ce71
commit
07e4669053
|
@ -1932,12 +1932,13 @@ static int xma_decode_packet(AVCodecContext *avctx, void *data,
|
||||||
for (i = 0; i < s->num_streams; i++) {
|
for (i = 0; i < s->num_streams; i++) {
|
||||||
const int start_ch = s->start_channel[i];
|
const int start_ch = s->start_channel[i];
|
||||||
void *left[1] = { frame->extended_data[start_ch + 0] };
|
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);
|
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);
|
av_audio_fifo_read(s->samples[1][i], right, nb_samples);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*got_frame_ptr = nb_samples > 0;
|
*got_frame_ptr = nb_samples > 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue