Showing the changes to libavfilter/graphparser.c (1 of 1 file). Show all
Unified · Split
| @@ -118,13 +118,16 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind · 117 unmodified lines | ||
| 118 | 118 | return AVERROR(ENOMEM); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | − if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") && | |
| 121 | + if (!strcmp(filt_name, "scale") && (!args || !strstr(args, "flags")) && | |
| 122 | 122 | ctx->scale_sws_opts) { |
| 123 | − tmp_args = av_asprintf("%s:%s", | |
| 124 | − args, ctx->scale_sws_opts); | |
| 125 | − if (!tmp_args) | |
| 126 | − return AVERROR(ENOMEM); | |
| 127 | − args = tmp_args; | |
| 123 | + if (args) { | |
| 124 | + tmp_args = av_asprintf("%s:%s", | |
| 125 | + args, ctx->scale_sws_opts); | |
| 126 | + if (!tmp_args) | |
| 127 | + return AVERROR(ENOMEM); | |
| 128 | + args = tmp_args; | |
| 129 | + } else | |
| 130 | + args = ctx->scale_sws_opts; | |
| 128 | 131 | } |
| 129 | 132 | |
| 130 | 133 | ret = avfilter_init_str(*filt_ctx, args); |