From 8aaab1113c00f2c90f3ce9ebe0c29af19cb155fd Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 10 Apr 2013 12:40:04 +0200 Subject: [PATCH 1/2] af_channelmap: ensure the output channel layout is valid. --- libavfilter/af_channelmap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index 2aac5381a6..34d2457efd 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -270,6 +270,12 @@ static av_cold int channelmap_init(AVFilterContext *ctx) } s->output_layout = fmt; } + if (!s->output_layout) { + av_log(ctx, AV_LOG_ERROR, "Output channel layout is not set and " + "cannot be guessed from the maps.\n"); + return AVERROR(EINVAL); + } + ff_add_channel_layout(&s->channel_layouts, s->output_layout); if (mode == MAP_PAIR_INT_STR || mode == MAP_PAIR_STR_STR) { From c22263d3e813d442df8fa5f5ba8993573fe775d8 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 10 Apr 2013 12:44:13 +0200 Subject: [PATCH 2/2] graphparser: only print filter arguments if they are non-NULL --- libavfilter/graphparser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index d00da9cb2d..00764b68b6 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -126,7 +126,10 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind ret = avfilter_init_str(*filt_ctx, args); if (ret < 0) { av_log(log_ctx, AV_LOG_ERROR, - "Error initializing filter '%s' with args '%s'\n", filt_name, args); + "Error initializing filter '%s'", filt_name); + if (args) + av_log(log_ctx, AV_LOG_ERROR, " with args '%s'", args); + av_log(log_ctx, AV_LOG_ERROR, "\n"); return ret; }