From 132e8eeccdcb2f7389f79381f667448ef357de66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 14 Feb 2023 22:46:32 +0100 Subject: [PATCH] Now these variables need to be initialized --- Common/Serialize/Serializer.h | 4 ++-- Core/SaveState.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Common/Serialize/Serializer.h b/Common/Serialize/Serializer.h index 5c1f813199..a7fa964a0c 100644 --- a/Common/Serialize/Serializer.h +++ b/Common/Serialize/Serializer.h @@ -275,8 +275,8 @@ public: template static Error Save(const Path &filename, const std::string &title, const char *gitVersion, T& _class) { - u8 *buffer; - size_t sz; + u8 *buffer = nullptr; + size_t sz = 0; Error error = MeasureAndSavePtr(_class, &buffer, &sz); // SaveFile takes ownership of buffer (malloc/free) diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index 54a6a4355b..836236e660 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -806,6 +806,8 @@ namespace SaveState bool HandleLoadFailure() { + WARN_LOG(SAVESTATE, "HandleLoadFailure - trying a rewind state."); + // Okay, first, let's give the rewind state a shot - maybe we can at least not reset entirely. // Even if this was a rewind, maybe we can still load a previous one. CChunkFileReader::Error result;