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:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user