avfiltergraph: check for sws opts being non-NULL before using them.

Avoid snprintfing a NULL pointer.

CC: libav-stable@libav.org
This commit is contained in:
Anton Khirnov 2013-03-17 16:14:58 +01:00
parent 817dff578f
commit 6e3c13a559
2 changed files with 8 additions and 2 deletions

View file

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