From 6267abac8add71a70409fd9987630c44fc56befd Mon Sep 17 00:00:00 2001 From: SwitchKaze Date: Thu, 25 Mar 2021 12:43:30 -0500 Subject: [PATCH 1/2] Fix console text bleeding --- src/console.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/console.c b/src/console.c index f3b0aa603..2d95e10b8 100644 --- a/src/console.c +++ b/src/console.c @@ -1652,6 +1652,7 @@ static void CON_DrawHudlines(void) { charflags = (*p & 0x7f) << V_CHARCOLORSHIFT; p++; + c++; } if (*p < HU_FONTSTART) ;//charwidth = 4 * con_scalefactor; @@ -1774,6 +1775,7 @@ static void CON_DrawConsole(void) { charflags = (*p & 0x7f) << V_CHARCOLORSHIFT; p++; + c++; } V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true); } From c3d5740e983891b18bd45fccf45ac89cd9345403 Mon Sep 17 00:00:00 2001 From: SwitchKaze Date: Tue, 6 Apr 2021 15:06:44 -0500 Subject: [PATCH 2/2] Fix console text bleeding edge case A single character could prematurely read if there were enough special characters to push 'c' past 'con_width'. --- src/console.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/console.c b/src/console.c index 2d95e10b8..208b55212 100644 --- a/src/console.c +++ b/src/console.c @@ -1654,6 +1654,8 @@ static void CON_DrawHudlines(void) p++; c++; } + if (c >= con_width) + break; if (*p < HU_FONTSTART) ;//charwidth = 4 * con_scalefactor; else @@ -1777,6 +1779,8 @@ static void CON_DrawConsole(void) p++; c++; } + if (c >= con_width) + break; V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true); } }