[FFmpeg-cvslog] graphparser: add a NULL check on the argument passed to strstr

Stefano Sabatini git at videolan.org
Tue Apr 26 04:23:18 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Wed Mar 30 21:30:31 2011 +0200| [f80b381bfd956e4470bdbc1854f88cf3ea0764a9] | committer: Anton Khirnov

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.

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f80b381bfd956e4470bdbc1854f88cf3ea0764a9
---

 libavfilter/graphparser.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
index dddb0a2..00fb57a 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;



More information about the ffmpeg-cvslog mailing list