avfilter/graphparser: Do not ignore scale_sws_opts if args == NULL

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-08-08 12:40:34 +02:00
parent d0e0757e9a
commit 41e733c1ef

View File

@ -118,13 +118,16 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") && if (!strcmp(filt_name, "scale") && (!args || !strstr(args, "flags")) &&
ctx->scale_sws_opts) { ctx->scale_sws_opts) {
tmp_args = av_asprintf("%s:%s", if (args) {
args, ctx->scale_sws_opts); tmp_args = av_asprintf("%s:%s",
if (!tmp_args) args, ctx->scale_sws_opts);
return AVERROR(ENOMEM); if (!tmp_args)
args = tmp_args; return AVERROR(ENOMEM);
args = tmp_args;
} else
args = ctx->scale_sws_opts;
} }
ret = avfilter_init_str(*filt_ctx, args); ret = avfilter_init_str(*filt_ctx, args);