changeset 141:d2d2ec541148 libavformat

allocate enough bytes
author tmmm
date Mon, 26 May 2003 20:53:09 +0000
parents 0617a3812600
children 720bab5adc70
files 4xm.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/4xm.c	Sun May 25 23:55:47 2003 +0000
+++ b/4xm.c	Mon May 26 20:53:09 2003 +0000
@@ -151,8 +151,9 @@
             }
             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;