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.
pull/6/merge
Stefano Sabatini 12 years ago
parent 29d46d7bce
commit 2b442ff5f5
  1. 7
      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);
}

Loading…
Cancel
Save