diff options
| author | Léo Lam <leo@leolam.fr> | 2020-11-29 00:09:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-29 00:09:30 +0100 |
| commit | 738e1a6dbbfa2d16f2ef73c7950ee02165ab16ac (patch) | |
| tree | 5d3b60bac54d88007ce7248f710a2b5e9ad84fd7 /Source/Core | |
| parent | cf32c4d47970c2ac10e3b99d80a38966e681d597 (diff) | |
| parent | 5642772ec45342284c119abf688f5871d755004f (diff) | |
Merge pull request #9297 from JosJuice/movie-game-id-comparison
Movie: Fix 83b9fef regressions
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/Movie.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/Movie.h | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index fa67c9d0bc..68dd2c60a4 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -227,7 +227,7 @@ void Init(const BootParameters& boot) ReadHeader(); std::thread md5thread(CheckMD5); md5thread.detach(); - if (tmpHeader.GetGameID() == SConfig::GetInstance().GetGameID()) + if (strncmp(tmpHeader.gameID.data(), SConfig::GetInstance().GetGameID().c_str(), 6)) { PanicAlertFmtT("The recorded game ({0}) is not the same as the selected game ({1})", tmpHeader.GetGameID(), SConfig::GetInstance().GetGameID()); diff --git a/Source/Core/Core/Movie.h b/Source/Core/Core/Movie.h index dd55bea55b..e76ea6a10e 100644 --- a/Source/Core/Core/Movie.h +++ b/Source/Core/Core/Movie.h @@ -5,6 +5,7 @@ #pragma once #include <array> +#include <cstring> #include <functional> #include <optional> #include <string> @@ -64,7 +65,10 @@ static_assert(sizeof(ControllerState) == 8, "ControllerState should be 8 bytes") #pragma pack(push, 1) struct DTMHeader { - std::string_view GetGameID() const { return {gameID.data(), gameID.size()}; } + std::string_view GetGameID() const + { + return {gameID.data(), strnlen(gameID.data(), gameID.size())}; + } std::array<u8, 4> filetype; // Unique Identifier (always "DTM"0x1A) |
