avfilter/graphparser: Do not ignore scale_sws_opts if args == NULL
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 8 Aug 2015 10:40:34 +0000 (12:40 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 8 Aug 2015 11:24:52 +0000 (13:24 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/graphparser.c

index dd331d1..9e6fe6a 100644 (file)
@@ -118,13 +118,16 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind
         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) {
-        tmp_args = av_asprintf("%s:%s",
-                 args, ctx->scale_sws_opts);
-        if (!tmp_args)
-            return AVERROR(ENOMEM);
-        args = tmp_args;
+        if (args) {
+            tmp_args = av_asprintf("%s:%s",
+                    args, ctx->scale_sws_opts);
+            if (!tmp_args)
+                return AVERROR(ENOMEM);
+            args = tmp_args;
+        } else
+            args = ctx->scale_sws_opts;
     }
 
     ret = avfilter_init_str(*filt_ctx, args);