Commit 79042a6e authored by Måns Rullgård's avatar Måns Rullgård

Fix memory leak introduced in r23933

Originally committed as revision 23998 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 08b317a2
......@@ -385,7 +385,8 @@ static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base){
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 @@ av_cold int MPV_common_init(MpegEncContext *s)
}
}
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 @@ void MPV_common_end(MpegEncContext *s)
}
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment