From 9140bc9548908687f7af32fd34d707b4732c070f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 28 Sep 2026 09:07:16 -0600 Subject: [PATCH] Serialize: Report the first bad section, and start with no title SetError overwrote the first bad section with whichever section a later error came from, and an error before any section read an uninitialized curTitle_. Co-Authored-By: Claude Opus 5.5 (1M context) --- Common/Serialize/Serializer.cpp | 4 +++- Common/Serialize/Serializer.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Common/Serialize/Serializer.cpp b/Common/Serialize/Serializer.cpp index 9e06b9ba04..b222d60be9 100644 --- a/Common/Serialize/Serializer.cpp +++ b/Common/Serialize/Serializer.cpp @@ -125,7 +125,9 @@ void PointerWrap::SetError(Error error_) { // and also not logspam like MEASURE will do in an error case. mode = PointerWrap::MODE_NOOP; // Also, remember the bad section. - firstBadSectionTitle_ = curTitle_; + if (!firstBadSectionTitle_) { + firstBadSectionTitle_ = curTitle_; + } } } diff --git a/Common/Serialize/Serializer.h b/Common/Serialize/Serializer.h index 89a512c26d..e583391f28 100644 --- a/Common/Serialize/Serializer.h +++ b/Common/Serialize/Serializer.h @@ -182,7 +182,7 @@ public: private: const char *firstBadSectionTitle_ = nullptr; - const char *curTitle_; + const char *curTitle_ = nullptr; u8 *ptrStart_; u8 *end_ = nullptr; std::vector checkpoints_;