]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_showpalette.c
Merge commit '3f5c99fcbb2c366d7bdef8500c19f43a33bdb6b9'
[ffmpeg] / libavfilter / vf_showpalette.c
index 807dfb1d9549953261a147189bb8618eef7c6802..f1627ba58e493cff7b7f8c193e3495b7a4c7f2f5 100644 (file)
@@ -50,14 +50,22 @@ static int query_formats(AVFilterContext *ctx)
     AVFilterFormats *in  = ff_make_format_list(in_fmts);
     AVFilterFormats *out = ff_make_format_list(out_fmts);
     if (!in || !out) {
-        av_freep(&in);
-        av_freep(&out);
-        return AVERROR(ENOMEM);
+        ret = AVERROR(ENOMEM);
+        goto fail;
     }
+
     if ((ret = ff_formats_ref(in , &ctx->inputs[0]->out_formats)) < 0 ||
         (ret = ff_formats_ref(out, &ctx->outputs[0]->in_formats)) < 0)
-        return ret;
+        goto fail;
     return 0;
+fail:
+    if (in)
+        av_freep(&in->formats);
+    av_freep(&in);
+    if (out)
+        av_freep(&out->formats);
+    av_freep(&out);
+    return ret;
 }
 
 static int config_output(AVFilterLink *outlink)
@@ -122,7 +130,7 @@ static const AVFilterPad showpalette_outputs[] = {
 
 AVFilter ff_vf_showpalette = {
     .name          = "showpalette",
-    .description   = NULL_IF_CONFIG_SMALL("Display frame palette"),
+    .description   = NULL_IF_CONFIG_SMALL("Display frame palette."),
     .priv_size     = sizeof(ShowPaletteContext),
     .query_formats = query_formats,
     .inputs        = showpalette_inputs,