From 8b3e4178725ae5b20e5521d86a38fac4412602ec Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Thu, 28 May 2026 17:40:20 +0300 Subject: [PATCH] Guard against illegal array access Hovering mouse over an option long enough that the popup text appears and scrolling to last page with mouse wheel would run into assertion error in gprintfdirty() Assert(pFontString!=NULL); if the option was one of the last ones that didn't have a text box in the last option page. --- Ja2/Options Screen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ja2/Options Screen.cpp b/Ja2/Options Screen.cpp index bd57e8bf..31c96a6f 100644 --- a/Ja2/Options Screen.cpp +++ b/Ja2/Options Screen.cpp @@ -1822,7 +1822,7 @@ void HandleHighLightedText( BOOLEAN fHighLight ) bLastRegion = -1; } - if( bHighLight != -1 ) + if( bHighLight != -1 && toggle_box_array[bHighLight] != -1) { if( bHighLight < OPT_FIRST_COLUMN_TOGGLE_CUT_OFF ) {