mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix potential index out of bounds (#19561)
This commit is contained in:
parent
e9ecf6ee4a
commit
0c8486f2d3
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue