Skip to content

Commit

Permalink
avfilter/graphparser: remove 256 char limit from create_filter()
Browse files Browse the repository at this point in the history
Fixes Ticket2803

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Aug 3, 2013
1 parent c0ef5d6 commit 61af627
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libavfilter/graphparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind
{
AVFilter *filt;
char inst_name[30];
char tmp_args[256];
char *tmp_args = NULL;
int ret;

snprintf(inst_name, sizeof(inst_name), "Parsed_%s_%d", filt_name, index);
Expand All @@ -118,8 +118,10 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind

if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") &&
ctx->scale_sws_opts) {
snprintf(tmp_args, sizeof(tmp_args), "%s:%s",
tmp_args = av_asprintf("%s:%s",
args, ctx->scale_sws_opts);
if (!tmp_args)
return AVERROR(ENOMEM);
args = tmp_args;
}

Expand All @@ -130,10 +132,10 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind
if (args)
av_log(log_ctx, AV_LOG_ERROR, " with args '%s'", args);
av_log(log_ctx, AV_LOG_ERROR, "\n");
return ret;
}

return 0;
av_free(tmp_args);
return ret;
}

/**
Expand Down

0 comments on commit 61af627

Please sign in to comment.