From 6d924b5a5f39e33a02c4b39cc5892911bb508d4e Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Wed, 14 Oct 2009 05:28:24 +0000 Subject: Release frame after decoding is done Originally committed as revision 20231 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ulti.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libavcodec/ulti.c') diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index f58874a607..a5aec1a3a9 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -55,6 +55,17 @@ static av_cold int ulti_decode_init(AVCodecContext *avctx) return 0; } +static av_cold int ulti_decode_end(AVCodecContext *avctx){ + UltimotionDecodeContext *s = avctx->priv_data; + AVFrame *pic = &s->frame; + + if (pic->data[0]) + avctx->release_buffer(avctx, pic); + av_freep(&s->frame); + + return 0; +} + static const int block_coords[8] = // 4x4 block coords in 8x8 superblock { 0, 0, 0, 4, 4, 4, 4, 0}; @@ -401,7 +412,7 @@ AVCodec ulti_decoder = { sizeof(UltimotionDecodeContext), ulti_decode_init, NULL, - NULL, + ulti_decode_end, ulti_decode_frame, CODEC_CAP_DR1, NULL, -- cgit v1.2.3