Prevent illegal array access (#159)

When using mousewheel to switch between pages in features screen, the HandleHighLightedText() function sometimes would retain valid bHighlight index, but toggle_box_array[bHighlight] == -1, which is used to access z113FeaturesToggleText[] and would later trigger Assertion in gprintfdirty() with pFontString == NULL
This commit is contained in:
Asdow
2023-05-28 15:05:43 +03:00
committed by GitHub
parent 1c82efb797
commit 744e9c92ec
+1 -1
View File
@@ -1517,7 +1517,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)
{