From 91a010fbdd023b3cac85f455fb3c32de3d2c3784 Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Sat, 4 May 2024 08:05:10 +0200 Subject: [PATCH] proc_ui: Fix crash due to incorrect version handling Resolves a crash in NEX Remix --- src/Cafe/OS/libs/proc_ui/proc_ui.cpp | 3 +++ src/Cafe/TitleList/TitleInfo.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Cafe/OS/libs/proc_ui/proc_ui.cpp b/src/Cafe/OS/libs/proc_ui/proc_ui.cpp index 5560568d..dd9a460f 100644 --- a/src/Cafe/OS/libs/proc_ui/proc_ui.cpp +++ b/src/Cafe/OS/libs/proc_ui/proc_ui.cpp @@ -391,6 +391,9 @@ namespace proc_ui { cemuLog_log(LogType::Force, "ProcUI: Trying to register callback before init"); cemu_assert_suspicious(); + // this shouldn't happen but lets set the memory pointers anyway to prevent a crash in case the user has incorrect meta info + s_memAllocPtr = gCoreinitData->MEMAllocFromDefaultHeap.GetMPTR(); + s_memFreePtr = gCoreinitData->MEMFreeToDefaultHeap.GetMPTR(); } ProcUIInternalCallbackEntry* entry = (ProcUIInternalCallbackEntry*)_AllocMem(sizeof(ProcUIInternalCallbackEntry)); entry->funcPtr = funcPtr; diff --git a/src/Cafe/TitleList/TitleInfo.cpp b/src/Cafe/TitleList/TitleInfo.cpp index 6d21929e..2f295811 100644 --- a/src/Cafe/TitleList/TitleInfo.cpp +++ b/src/Cafe/TitleList/TitleInfo.cpp @@ -563,7 +563,7 @@ bool TitleInfo::ParseAppXml(std::vector& appXmlData) else if (name == "group_id") m_parsedAppXml->group_id = (uint32)std::stoull(child.text().as_string(), nullptr, 16); else if (name == "sdk_version") - m_parsedAppXml->sdk_version = (uint32)std::stoull(child.text().as_string(), nullptr, 16); + m_parsedAppXml->sdk_version = (uint32)std::stoull(child.text().as_string(), nullptr, 10); } return true; }