avfilter/vf_maskfun: fix memleak
authorPaul B Mahol <onemda@gmail.com>
Fri, 18 Oct 2019 19:57:20 +0000 (21:57 +0200)
committerPaul B Mahol <onemda@gmail.com>
Fri, 18 Oct 2019 19:57:20 +0000 (21:57 +0200)
Fixes #8305

libavfilter/vf_maskfun.c

index a8c6466..4ceb21b 100644 (file)
@@ -248,6 +248,13 @@ static int config_input(AVFilterLink *inlink)
     return 0;
 }
 
+static av_cold void uninit(AVFilterContext *ctx)
+{
+    MaskFunContext *s = ctx->priv;
+
+    av_frame_free(&s->empty);
+}
+
 static const AVFilterPad maskfun_inputs[] = {
     {
         .name           = "default",
@@ -272,6 +279,7 @@ AVFilter ff_vf_maskfun = {
     .description   = NULL_IF_CONFIG_SMALL("Create Mask."),
     .priv_size     = sizeof(MaskFunContext),
     .query_formats = query_formats,
+    .uninit        = uninit,
     .inputs        = maskfun_inputs,
     .outputs       = maskfun_outputs,
     .priv_class    = &maskfun_class,