1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Guard against illegal access

This commit is contained in:
Gymnasiast
2020-05-19 21:25:27 +02:00
parent 4b25345d8d
commit de69bbd661

View File

@@ -35,8 +35,12 @@ struct GamePalette
{
PaletteBGRA Colour[PALETTE_SIZE];
const PaletteBGRA& operator[](uint16_t idx) const
const PaletteBGRA operator[](uint16_t idx) const
{
assert(idx < PALETTE_SIZE);
if (idx >= PALETTE_SIZE)
return {};
return Colour[idx];
}