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

Stefano Sabatini stefasab at gmail.com
Mon Jun 17 12:43:43 CEST 2013


On date Sunday 2013-06-16 22:01:37 +0200, Alexander Strasser encoded:
> 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);
>      }

LGTM, thanks.


More information about the ffmpeg-devel mailing list