From 1855edba3744d07c76ef5cc0a50a422e9c1ffc76 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 20 Oct 2022 18:18:22 +0200 Subject: [PATCH] - don't crash on null pointers in V_GetFont. --- src/common/fonts/v_font.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/fonts/v_font.cpp b/src/common/fonts/v_font.cpp index 28af852028..3c9823abea 100644 --- a/src/common/fonts/v_font.cpp +++ b/src/common/fonts/v_font.cpp @@ -92,6 +92,7 @@ TArray TranslationColors; FFont *V_GetFont(const char *name, const char *fontlumpname) { + if (name != nullptr) return nullptr; if (!stricmp(name, "DBIGFONT")) name = "BigFont"; else if (!stricmp(name, "CONFONT")) name = "ConsoleFont"; // several mods have used the name CONFONT directly and effectively duplicated the font. else if (!stricmp(name, "INDEXFON")) name = "IndexFont"; // Same here - for whatever reason some people had to use its 8 character name...