Commit 2b442ff5 authored by Stefano Sabatini's avatar 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.
parent 29d46d7b
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment