[FFmpeg-devel] [RFC][PATCH 1/2] lavfi/src_movie: Check pointer is not NULL before deref

Alexander Strasser eclipse7 at gmx.net
Sun Jun 16 22:01:37 CEST 2013

Also do not check against empty string, the lower levels should
be able to deal with it.

Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>

In my testing the empty filename just failed to open
as expected.

The other case that was not checked happens if you
do not provide any filename option (not even empty)
at all. This fails now with filname not provided.

 libavfilter/src_movie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index af5db7a..f52d3a4 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -197,7 +197,7 @@ static av_cold int movie_common_init(AVFilterContext *ctx)
     char name[16];
     AVStream *st;
-    if (!*movie->file_name) {
+    if (!movie->file_name) {
         av_log(ctx, AV_LOG_ERROR, "No filename provided!\n");
         return AVERROR(EINVAL);

More information about the ffmpeg-devel mailing list