graphparser: add a NULL check on the argument passed to strstr
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Wed, 30 Mar 2011 19:30:31 +0000 (21:30 +0200)
committerAnton Khirnov <anton@khirnov.net>
Mon, 25 Apr 2011 20:45:44 +0000 (22:45 +0200)
Fix crash in create_filter() which occurrs if a scale filter with no
args is provided.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavfilter/graphparser.c

index dddb0a2..00fb57a 100644 (file)
@@ -121,7 +121,7 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind
         return ret;
     }
 
-    if (!strcmp(filt_name, "scale") && !strstr(args, "flags")) {
+    if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags")) {
         snprintf(tmp_args, sizeof(tmp_args), "%s:%s",
                  args, ctx->scale_sws_opts);
         args = tmp_args;