aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2014-02-08 12:26:13 +0100
committerJanne Grunau <janne-libav@jannau.net>2014-02-09 18:50:53 +0100
commit6a8475dc4f10d65edb7faa8df6e035af0ddcce19 (patch)
treefeb3219561b73db78e10f719c47382d46e209a65
parentd6eac2f1bcce0cb85fac5d50fcfe94bc490d4a5e (diff)
downloadffmpeg-6a8475dc4f10d65edb7faa8df6e035af0ddcce19.tar.gz
asvenc: free avctx->coded_frame on codec close
-rw-r--r--libavcodec/asvenc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c
index 40257f0c7f..6c83c9293a 100644
--- a/libavcodec/asvenc.c
+++ b/libavcodec/asvenc.c
@@ -263,6 +263,12 @@ static av_cold int encode_init(AVCodecContext *avctx){
return 0;
}
+static av_cold int asv_encode_close(AVCodecContext *avctx)
+{
+ av_frame_free(&avctx->coded_frame);
+
+ return 0;
+}
#if CONFIG_ASV1_ENCODER
AVCodec ff_asv1_encoder = {
@@ -273,6 +279,7 @@ AVCodec ff_asv1_encoder = {
.priv_data_size = sizeof(ASV1Context),
.init = encode_init,
.encode2 = encode_frame,
+ .close = asv_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
};
@@ -287,6 +294,7 @@ AVCodec ff_asv2_encoder = {
.priv_data_size = sizeof(ASV1Context),
.init = encode_init,
.encode2 = encode_frame,
+ .close = asv_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
};