Commit 80876320 authored by Clément Bœsch's avatar Clément Bœsch

avfilter/showpalette: fix leak in case of error

Fixes CID1270820
Fixes CID1270818
parent 80f44eaf
...@@ -48,8 +48,11 @@ static int query_formats(AVFilterContext *ctx) ...@@ -48,8 +48,11 @@ static int query_formats(AVFilterContext *ctx)
static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE}; static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE};
AVFilterFormats *in = ff_make_format_list(in_fmts); AVFilterFormats *in = ff_make_format_list(in_fmts);
AVFilterFormats *out = ff_make_format_list(out_fmts); AVFilterFormats *out = ff_make_format_list(out_fmts);
if (!in || !out) if (!in || !out) {
av_freep(&in);
av_freep(&out);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
}
ff_formats_ref(in, &ctx->inputs[0]->out_formats); ff_formats_ref(in, &ctx->inputs[0]->out_formats);
ff_formats_ref(out, &ctx->outputs[0]->in_formats); ff_formats_ref(out, &ctx->outputs[0]->in_formats);
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment