[FFmpeg-devel] [PATCH] lavfi/graphparser: fix parsing error in case of NULL sws_opts addition

Stefano Sabatini stefasab at gmail.com
Mon Oct 15 10:22:59 CEST 2012


If sws_opts was NULL it was resulting in the args being set to
"00:-1:(null)", which with the new parsing code was generating a syntax
failure.
---
 libavfilter/graphparser.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
index c34651f..8792d1e 100644
--- a/libavfilter/graphparser.c
+++ b/libavfilter/graphparser.c
@@ -123,7 +123,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;
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list