summaryrefslogtreecommitdiff
path: root/libavformat/4xm.c
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2003-05-26 20:53:09 +0000
committerMike Melanson <mike@multimedia.cx>2003-05-26 20:53:09 +0000
commit5a634a69521ce53b1e6535ab0de5c1608b8060a8 (patch)
treec260547baa3313191ad93a172182ce1866c94449 /libavformat/4xm.c
parent59fcece91053804a5daa061a2e16f548f3357980 (diff)
allocate enough bytes
Originally committed as revision 1908 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r--libavformat/4xm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index c1d5f67e8c..b45fd05b1d 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -151,8 +151,9 @@ static int fourxm_read_header(AVFormatContext *s,
}
current_track = LE_32(&header[i + 8]);
if (current_track + 1 > fourxm->track_count) {
- fourxm->track_count++;
- fourxm->tracks = av_realloc(fourxm->tracks, fourxm->track_count);
+ fourxm->track_count = current_track + 1;
+ fourxm->tracks = av_realloc(fourxm->tracks,
+ fourxm->track_count * sizeof(AudioTrack));
if (!fourxm->tracks) {
av_free(header);
return AVERROR_NOMEM;