From dcd6e7f99f00e00525f67109e4fcfd1e9efbabf6 Mon Sep 17 00:00:00 2001 From: Valentin Vanelslande Date: Fri, 5 Oct 2018 17:20:09 -0500 Subject: [PATCH] movie: fix some checks Fixes invalid movie error --- src/core/movie.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/movie.cpp b/src/core/movie.cpp index 3b05f77d0e..a0f237cf3d 100644 --- a/src/core/movie.cpp +++ b/src/core/movie.cpp @@ -453,7 +453,7 @@ static boost::optional ReadHeader(const std::string& movie_file) { void Movie::PrepareForPlayback(const std::string& movie_file) { auto header = ReadHeader(movie_file); - if (header != boost::none) + if (header == boost::none) return; init_time = header.value().clock_init_time; @@ -468,7 +468,7 @@ void Movie::PrepareForRecording() { Movie::ValidationResult Movie::ValidateMovie(const std::string& movie_file, u64 program_id) const { LOG_INFO(Movie, "Validating Movie file '{}'", movie_file); auto header = ReadHeader(movie_file); - if (header != boost::none) + if (header == boost::none) return ValidationResult::Invalid; return ValidateHeader(header.value(), program_id); @@ -476,7 +476,7 @@ Movie::ValidationResult Movie::ValidateMovie(const std::string& movie_file, u64 u64 Movie::GetMovieProgramID(const std::string& movie_file) const { auto header = ReadHeader(movie_file); - if (header != boost::none) + if (header == boost::none) return 0; return static_cast(header.value().program_id);