From 7865589f4810e6a55d632a4d97a6e20510e6194b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 11 Mar 2019 12:55:09 +0100 Subject: [PATCH] sceFontLib: Don't call the callback if double-free. Should fix one part of #6627 --- Core/HLE/sceFont.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceFont.cpp b/Core/HLE/sceFont.cpp index 1402a908ef..8a4ee5ed92 100644 --- a/Core/HLE/sceFont.cpp +++ b/Core/HLE/sceFont.cpp @@ -436,7 +436,9 @@ public: } u32 args[2] = { params_.userDataAddr, (u32)handle_ }; // TODO: The return value of this is leaking. - __KernelDirectMipsCall(params_.freeFuncAddr, 0, args, 2, false); + if (handle_) { // Avoid calling free-callback on double-free + __KernelDirectMipsCall(params_.freeFuncAddr, 0, args, 2, false); + } handle_ = 0; fonts_.clear(); isfontopen_.clear();