From 5267c87ca7f348e272415ddd7889562b05fa5d3c Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sun, 16 Nov 2025 12:28:08 +0100 Subject: [PATCH] Overlays: check return value of stbtt_InitFont --- rpcs3/Emu/RSX/Overlays/overlay_fonts.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/Overlays/overlay_fonts.cpp b/rpcs3/Emu/RSX/Overlays/overlay_fonts.cpp index e8305ef9b1..572cb71134 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_fonts.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_fonts.cpp @@ -185,9 +185,10 @@ namespace rsx // Check if the character exists in the font stbtt_fontinfo info; - stbtt_InitFont(&info, bytes.data(), stbtt_GetFontOffsetForIndex(bytes.data(), 0)); - - font_found = stbtt_FindGlyphIndex(&info, c) != 0; + if (stbtt_InitFont(&info, bytes.data(), stbtt_GetFontOffsetForIndex(bytes.data(), 0)) != 0) + { + font_found = stbtt_FindGlyphIndex(&info, c) != 0; + } if (!font_found) {