forked from rosebudai/OpenRCT2-Web
Guard against illegal access
This commit is contained in:
1 file changed
+5
-1
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user