diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-10-02 00:38:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-02 01:02:29 +0200 |
commit | a1876e0072aa0c69f037e0cafaca1a54bf2e189b (patch) | |
tree | 6f0c470539ea4876ba41d16a2df850962572dad0 | |
parent | 8c851ef5a81fb0429453c43fdcfc974ce1b6e447 (diff) | |
download | ffmpeg-a1876e0072aa0c69f037e0cafaca1a54bf2e189b.tar.gz |
Fix use of uninitialized memory in 4X Technologies demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/4xm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c index cd4066d423..f535c49420 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -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]); |