From 9c2b2b681a854f0c763c193d894d0aa5ba0046ce Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Fri, 2 Dec 2022 00:28:01 +0100 Subject: [PATCH] Fix cache map load bug * Fix bug where the version wasn't read correctly during cache map load. * Pass address of array to CIOStream Read wrapper. --- r5dev/core/init.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r5dev/core/init.cpp b/r5dev/core/init.cpp index 14af50c5..ed7793b2 100644 --- a/r5dev/core/init.cpp +++ b/r5dev/core/init.cpp @@ -497,7 +497,7 @@ bool SigDB_Init() } sigDbHeader.m_nVersion = sigDbStream.Read(); - if (sigDbHeader.m_nMagic != SIGDB_VERSION) + if (sigDbHeader.m_nVersion != SIGDB_VERSION) { return false; } @@ -509,7 +509,7 @@ bool SigDB_Init() vData.resize(nSize); uint8_t* pBuf = vData.data(); - sigDbStream.Read(pBuf, nSize); + sigDbStream.Read(*pBuf, nSize); if (!g_SigCache.m_Cache.ParseFromArray(pBuf, nSize)) {