Commit f5a6a833 authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/af_channelmap: Reorder operations to avoid memleak

Fixes CID1322346
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 59361d8c
...@@ -290,15 +290,15 @@ static int channelmap_query_formats(AVFilterContext *ctx) ...@@ -290,15 +290,15 @@ static int channelmap_query_formats(AVFilterContext *ctx)
AVFilterChannelLayouts *layouts; AVFilterChannelLayouts *layouts;
AVFilterChannelLayouts *channel_layouts = NULL; AVFilterChannelLayouts *channel_layouts = NULL;
layouts = ff_all_channel_layouts();
if (!layouts)
return AVERROR(ENOMEM);
ff_add_channel_layout(&channel_layouts, s->output_layout); ff_add_channel_layout(&channel_layouts, s->output_layout);
ff_set_common_formats(ctx, ff_planar_sample_fmts()); ff_set_common_formats(ctx, ff_planar_sample_fmts());
ff_set_common_samplerates(ctx, ff_all_samplerates()); ff_set_common_samplerates(ctx, ff_all_samplerates());
layouts = ff_all_channel_layouts();
if (!layouts)
return AVERROR(ENOMEM);
ff_channel_layouts_ref(layouts, &ctx->inputs[0]->out_channel_layouts); ff_channel_layouts_ref(layouts, &ctx->inputs[0]->out_channel_layouts);
ff_channel_layouts_ref(channel_layouts, &ctx->outputs[0]->in_channel_layouts); ff_channel_layouts_ref(channel_layouts, &ctx->outputs[0]->in_channel_layouts);
......
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