diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-04 00:10:41 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-04 00:10:41 +0200 |
commit | f5a6a8336fa21dc6d6b6a9a07fa15f8f2240a840 (patch) | |
tree | 99d45e52cc145d1f61d4571ee03b56388cee43b6 /libavfilter/af_channelmap.c | |
parent | 59361d8c9d319098e3c96db2ac600030467212be (diff) | |
download | ffmpeg-f5a6a8336fa21dc6d6b6a9a07fa15f8f2240a840.tar.gz |
avfilter/af_channelmap: Reorder operations to avoid memleak
Fixes CID1322346
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter/af_channelmap.c')
-rw-r--r-- | libavfilter/af_channelmap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index dae79c14b6..37b47b2d7b 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -290,15 +290,15 @@ static int channelmap_query_formats(AVFilterContext *ctx) AVFilterChannelLayouts *layouts; AVFilterChannelLayouts *channel_layouts = NULL; + layouts = ff_all_channel_layouts(); + if (!layouts) + return AVERROR(ENOMEM); + ff_add_channel_layout(&channel_layouts, s->output_layout); ff_set_common_formats(ctx, ff_planar_sample_fmts()); 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(channel_layouts, &ctx->outputs[0]->in_channel_layouts); |