Commit a1876e00 authored by Laurent Aimar's avatar Laurent Aimar Committed by Michael Niedermayer

Fix use of uninitialized memory in 4X Technologies demuxer.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8c851ef5
......@@ -173,14 +173,16 @@ static int fourxm_read_header(AVFormatContext *s,
goto fail;
}
if (current_track + 1 > fourxm->track_count) {
fourxm->track_count = current_track + 1;
fourxm->tracks = av_realloc_f(fourxm->tracks,
sizeof(AudioTrack),
fourxm->track_count);
current_track + 1);
if (!fourxm->tracks) {
ret= AVERROR(ENOMEM);
goto fail;
}
memset(&fourxm->tracks[fourxm->track_count], 0,
sizeof(AudioTrack) * (current_track + 1 - fourxm->track_count));
fourxm->track_count = current_track + 1;
}
fourxm->tracks[current_track].adpcm = AV_RL32(&header[i + 12]);
fourxm->tracks[current_track].channels = AV_RL32(&header[i + 36]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment