# HG changeset patch # User mru # Date 1278082821 0 # Node ID 84df7b6b1929d9da6893886666748af4fdb3d67a # Parent 190efe3dee2b52a59eafeef06340fe21569af21b Fix memory leak introduced in r23933 diff -r 190efe3dee2b -r 84df7b6b1929 mpegvideo.c --- 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);