]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
memleak / CID124 RUN2
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 28 May 2008 22:26:35 +0000 (22:26 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 28 May 2008 22:26:35 +0000 (22:26 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13512 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/sierravmd.c

index 5e68a81c4354fd1b38a7803b8adb303c12c020de..fc757906c48859f806134b9ec7028a7590d0f4ae 100644 (file)
@@ -146,11 +146,11 @@ static int vmd_read_header(AVFormatContext *s,
     vmd->frame_table = NULL;
     sound_buffers = AV_RL16(&vmd->vmd_header[808]);
     raw_frame_table_size = vmd->frame_count * 6;
-    raw_frame_table = av_malloc(raw_frame_table_size);
     if(vmd->frame_count * vmd->frames_per_block  >= UINT_MAX / sizeof(vmd_frame_t)){
         av_log(s, AV_LOG_ERROR, "vmd->frame_count * vmd->frames_per_block too large\n");
         return -1;
     }
+    raw_frame_table = av_malloc(raw_frame_table_size);
     vmd->frame_table = av_malloc((vmd->frame_count * vmd->frames_per_block + sound_buffers) * sizeof(vmd_frame_t));
     if (!raw_frame_table || !vmd->frame_table) {
         av_free(raw_frame_table);