[FFmpeg-cvslog] lavfi/movie: return proper error code in case of av_get_token() allocation failure

Stefano Sabatini git at videolan.org
Tue Nov 6 23:36:10 CET 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Tue Nov  6 23:28:43 2012 +0100| [2b442ff5f5c1499428b396f585d5d90c22a3c98e] | committer: Stefano Sabatini

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.

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

 libavfilter/src_movie.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index 8ebad6d..87b6d2a 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);
     }



More information about the ffmpeg-cvslog mailing list