changeset 12076:84df7b6b1929 libavcodec

Fix memory leak introduced in r23933
author mru
date Fri, 02 Jul 2010 15:00:21 +0000
parents 190efe3dee2b
children 66cd745af30f
files mpegvideo.c
diffstat 1 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mpegvideo.c	Fri Jul 02 13:00:18 2010 +0000
+++ b/mpegvideo.c	Fri Jul 02 15:00:21 2010 +0000
@@ -385,7 +385,8 @@
         s->pblocks[i] = &s->block[i];
     }
 
-    if (s->ac_val_base) {
+    if (s->out_format == FMT_H263) {
+        /* ac values */
         FF_ALLOCZ_OR_GOTO(s->avctx, s->ac_val_base, yc_size * sizeof(int16_t) * 16, fail);
         s->ac_val[0] = s->ac_val_base + s->b8_stride + 1;
         s->ac_val[1] = s->ac_val_base + y_size + s->mb_stride + 1;
@@ -621,12 +622,6 @@
             }
     }
     if (s->out_format == FMT_H263) {
-        /* ac values */
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->ac_val_base, yc_size * sizeof(int16_t) * 16, fail);
-        s->ac_val[0] = s->ac_val_base + s->b8_stride + 1;
-        s->ac_val[1] = s->ac_val_base + y_size + s->mb_stride + 1;
-        s->ac_val[2] = s->ac_val[1] + c_size;
-
         /* cbp values */
         FF_ALLOCZ_OR_GOTO(s->avctx, s->coded_block_base, y_size, fail);
         s->coded_block= s->coded_block_base + s->b8_stride + 1;
@@ -728,7 +723,6 @@
     }
 
     av_freep(&s->dc_val_base);
-    av_freep(&s->ac_val_base);
     av_freep(&s->coded_block_base);
     av_freep(&s->mbintra_table);
     av_freep(&s->cbp_table);