Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-21 18:40:38 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-21 18:40:38 +0300
commit39867f3e098ab304cd3bef0ace19d73617cdb817 (patch)
tree3f7ce3db55b92bf4b3c923df99bc003b92eb4d0c /libavfilter/af_channelmap.c
parentf2d7409c72563745d38bc986f28c06741194e6c5 (diff)
avfilter/af_channelmap: Move ff_add_channel_layout() call to querry_format()
Avoids memleak if querry_formats is not called Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter/af_channelmap.c')
-rw-r--r--libavfilter/af_channelmap.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index f8289ccf5e..06931456fb 100644
--- a/libavfilter/af_channelmap.c
+++ b/libavfilter/af_channelmap.c
@@ -275,8 +275,6 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
return AVERROR(EINVAL);
}
- ff_add_channel_layout(&s->channel_layouts, s->output_layout);
-
if (mode == MAP_PAIR_INT_STR || mode == MAP_PAIR_STR_STR) {
for (i = 0; i < s->nch; i++) {
s->map[i].out_channel_idx = av_get_channel_layout_channel_index(
@@ -299,6 +297,7 @@ static int channelmap_query_formats(AVFilterContext *ctx)
if (!layouts)
return AVERROR(ENOMEM);
+ ff_add_channel_layout(&s->channel_layouts, s->output_layout);
ff_channel_layouts_ref(layouts, &ctx->inputs[0]->out_channel_layouts);
ff_channel_layouts_ref(s->channel_layouts, &ctx->outputs[0]->in_channel_layouts);