From 128d18155867c3523f4c224f23ecacb8df368c37 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 28 Feb 2013 08:03:52 -0800 Subject: [PATCH] Fix crash in sceFontClose(). Still some other issues but Fieldrunners now plays again with tons of errors showing. --- Core/HLE/sceFont.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Core/HLE/sceFont.cpp b/Core/HLE/sceFont.cpp index a3ff7af981..6cc340c634 100644 --- a/Core/HLE/sceFont.cpp +++ b/Core/HLE/sceFont.cpp @@ -577,10 +577,16 @@ u32 sceFontOpenUserFile(u32 libHandle, const char *fileName, u32 mode, u32 error } int sceFontClose(u32 fontHandle) { - INFO_LOG(HLE, "sceFontClose(%x)", fontHandle); LoadedFont *font = GetLoadedFont(fontHandle, false); - FontLib *fontLib = font->GetFontLib(); - fontLib->CloseFont(font); + if (font) + { + INFO_LOG(HLE, "sceFontClose(%x)", fontHandle); + FontLib *fontLib = font->GetFontLib(); + if (fontLib) + fontLib->CloseFont(font); + } + else + ERROR_LOG(HLE, "sceFontClose(%x) - font not open?", fontHandle); return 0; }