mirror of https://git.ffmpeg.org/ffmpeg.git
Fix use of uninitialized memory in 4X Technologies demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
8c851ef5a8
commit
a1876e0072
|
@ -173,14 +173,16 @@ static int fourxm_read_header(AVFormatContext *s,
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (current_track + 1 > fourxm->track_count) {
|
if (current_track + 1 > fourxm->track_count) {
|
||||||
fourxm->track_count = current_track + 1;
|
|
||||||
fourxm->tracks = av_realloc_f(fourxm->tracks,
|
fourxm->tracks = av_realloc_f(fourxm->tracks,
|
||||||
sizeof(AudioTrack),
|
sizeof(AudioTrack),
|
||||||
fourxm->track_count);
|
current_track + 1);
|
||||||
if (!fourxm->tracks) {
|
if (!fourxm->tracks) {
|
||||||
ret= AVERROR(ENOMEM);
|
ret= AVERROR(ENOMEM);
|
||||||
goto fail;
|
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].adpcm = AV_RL32(&header[i + 12]);
|
||||||
fourxm->tracks[current_track].channels = AV_RL32(&header[i + 36]);
|
fourxm->tracks[current_track].channels = AV_RL32(&header[i + 36]);
|
||||||
|
|
Loading…
Reference in New Issue