1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-11 10:02:27 +01:00

Fix potential index out of bounds (#19561)

This commit is contained in:
Johan Mattsson
2023-03-05 21:17:03 +01:00
committed by GitHub
parent e9ecf6ee4a
commit 0c8486f2d3

View File

@@ -201,7 +201,7 @@ FormatToken FormatTokenFromTextColour(size_t textColour)
FormatToken::ColourPaleLavender, FormatToken::ColourPaleGold, FormatToken::ColourLightPink,
FormatToken::ColourPearlAqua, FormatToken::ColourPaleSilver,
};
if (textColour > std::size(tokens))
if (textColour >= std::size(tokens))
return FormatToken::ColourBlack;
return tokens[textColour];
}