]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_weave: do not leak unused frame
authorPaul B Mahol <onemda@gmail.com>
Fri, 9 Sep 2016 09:58:18 +0000 (11:58 +0200)
committerPaul B Mahol <onemda@gmail.com>
Fri, 9 Sep 2016 09:58:18 +0000 (11:58 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/vf_weave.c

index 2f0784e703ad71553a65a44b1628f491ce7b5fdc..a5fc1b7403cc161eeb482e73bde3069502692e93 100644 (file)
@@ -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,
 };