From 653ca058079ccf65f487abd5f30f479903ec82ac Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 9 Sep 2016 11:58:18 +0200 Subject: [PATCH] avfilter/vf_weave: do not leak unused frame Signed-off-by: Paul B Mahol --- libavfilter/vf_weave.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c index 2f0784e703..a5fc1b7403 100644 --- a/libavfilter/vf_weave.c +++ b/libavfilter/vf_weave.c @@ -115,6 +115,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) return ff_filter_frame(outlink, out); } +static av_cold void uninit(AVFilterContext *ctx) +{ + WeaveContext *s = ctx->priv; + + av_frame_free(&s->prev); +} + static const AVFilterPad weave_inputs[] = { { .name = "default", @@ -138,6 +145,7 @@ AVFilter ff_vf_weave = { .description = NULL_IF_CONFIG_SMALL("Weave input video fields into frames."), .priv_size = sizeof(WeaveContext), .priv_class = &weave_class, + .uninit = uninit, .inputs = weave_inputs, .outputs = weave_outputs, };