提交 79964745 编写于 作者: L Laurent Aimar 提交者: Janne Grunau

4xmdemux: prevent use of uninitialized memory

Signed-off-by: NJanne Grunau <janne-libav@jannau.net>
上级 8d518a9c
......@@ -173,13 +173,15 @@ 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(fourxm->tracks,
fourxm->track_count * sizeof(AudioTrack));
(current_track + 1) * sizeof(AudioTrack));
if (!fourxm->tracks) {
ret= AVERROR(ENOMEM);
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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册