aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-07-02 15:00:21 +0000
committerMåns Rullgård <mans@mansr.com>2010-07-02 15:00:21 +0000
commit79042a6eb150e5d80a0e7bf242d9945d1246703b (patch)
tree15e3940220fe89e034d03a4a4e356d3388edebf4 /libavcodec/mpegvideo.c
parent08b317a23855d17971dcfa112248968234147f4b (diff)
downloadffmpeg-79042a6eb150e5d80a0e7bf242d9945d1246703b.tar.gz
Fix memory leak introduced in r23933
Originally committed as revision 23998 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index a6ccd69e1d..684bdfe138 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -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);