From af265d017d761d3b23a4ae7b5f913d623399c463 Mon Sep 17 00:00:00 2001 From: Indev Date: Thu, 11 Apr 2024 18:55:55 +0300 Subject: [PATCH] Fix potential negative array index in V_ThinStringWidth --- src/v_video.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/v_video.c b/src/v_video.c index c56711f20..7b9383f06 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2944,6 +2944,9 @@ INT32 V_ThinStringWidth(const char *string, INT32 option) if ((UINT8)c >= 0x80 && (UINT8)c <= 0x8F) //color parsing! -Inuyasha 2.16.09 continue; + if (c < HU_FONTSTART) + continue; + if (!lowercase || !tny_font[c-HU_FONTSTART]) c = toupper(c); c -= HU_FONTSTART;