From f80b381bfd956e4470bdbc1854f88cf3ea0764a9 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Wed, 30 Mar 2011 21:30:31 +0200 Subject: [PATCH] graphparser: add a NULL check on the argument passed to strstr Fix crash in create_filter() which occurrs if a scale filter with no args is provided. Signed-off-by: Anton Khirnov --- libavfilter/graphparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index dddb0a2070..00fb57ad57 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -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;