diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-11-06 23:28:43 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-11-06 23:31:16 +0100 |
commit | 2b442ff5f5c1499428b396f585d5d90c22a3c98e (patch) | |
tree | fb870b1a80997a52ce30ae9882b892dfb6ddd59d /libavfilter/src_movie.c | |
parent | 29d46d7bce1c67852e4c6e22605144eb32b21072 (diff) | |
download | ffmpeg-2b442ff5f5c1499428b396f585d5d90c22a3c98e.tar.gz |
lavfi/movie: return proper error code in case of av_get_token() allocation failure
Also slightly clarify logic, and should fix coverity issue CID 717771.
Diffstat (limited to 'libavfilter/src_movie.c')
-rw-r--r-- | libavfilter/src_movie.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c index 8ebad6d8ca..87b6d2af9f 100644 --- a/libavfilter/src_movie.c +++ b/libavfilter/src_movie.c @@ -197,9 +197,12 @@ static av_cold int movie_common_init(AVFilterContext *ctx, const char *args, con movie->class = class; av_opt_set_defaults(movie); - if (args) + if (args) { movie->file_name = av_get_token(&args, ":"); - if (!movie->file_name || !*movie->file_name) { + if (!movie->file_name) + return AVERROR(ENOMEM); + } + if (!args || !*movie->file_name) { av_log(ctx, AV_LOG_ERROR, "No filename provided!\n"); return AVERROR(EINVAL); } |