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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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];
}