diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-12-25 19:35:19 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-12-25 20:50:20 +0100 |
commit | 80dc7c0160fb27e46fc0caae8af10b3d63730c7c (patch) | |
tree | cde8f8998f66803b17429415661631a75b24a92d /libavcodec/avs.c | |
parent | 06e8d38f2bebfb3c79c9f5e907f975ed02841f94 (diff) | |
download | ffmpeg-80dc7c0160fb27e46fc0caae8af10b3d63730c7c.tar.gz |
avs: call release_buffer() at the end.
Fixes a memleak.
Diffstat (limited to 'libavcodec/avs.c')
-rw-r--r-- | libavcodec/avs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/avs.c b/libavcodec/avs.c index 3ccded3f8c..b3cd5b1478 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -161,6 +161,15 @@ static av_cold int avs_decode_init(AVCodecContext * avctx) return 0; } +static av_cold int avs_decode_end(AVCodecContext *avctx) +{ + AvsContext *s = avctx->priv_data; + if (s->picture.data[0]) + avctx->release_buffer(avctx, &s->picture); + return 0; +} + + AVCodec ff_avs_decoder = { .name = "avs", .type = AVMEDIA_TYPE_VIDEO, @@ -168,6 +177,7 @@ AVCodec ff_avs_decoder = { .priv_data_size = sizeof(AvsContext), .init = avs_decode_init, .decode = avs_decode_frame, + .close = avs_decode_end, .capabilities = CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("AVS (Audio Video Standard) video"), }; |