From 2f86e7bd12d8023da3349f10490b1e5b64531e23 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. --- libavfilter/graphparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index 47179e5e54..4f11529900 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;