diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-04 00:56:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-04 00:56:55 +0200 |
commit | 61af627d56c785650ac3d235f6356ee3bc5676ee (patch) | |
tree | f39e61194b6b3e21c0f92758b30d7130f4eb6970 /libavfilter/graphparser.c | |
parent | c0ef5d6c169fb0668e2ba029f9cc34ad32db9520 (diff) | |
download | ffmpeg-61af627d56c785650ac3d235f6356ee3bc5676ee.tar.gz |
avfilter/graphparser: remove 256 char limit from create_filter()
Fixes Ticket2803
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/graphparser.c')
-rw-r--r-- | libavfilter/graphparser.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index 92fd53b95e..e14c4ecc32 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -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); @@ -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; } @@ -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; } /** |