mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 14:54:30 +01:00
Return nullptr in get_sprite if out of range
This commit is contained in:
@@ -85,6 +85,10 @@ rct_sprite* get_sprite(size_t sprite_idx)
|
||||
return nullptr;
|
||||
}
|
||||
openrct2_assert(sprite_idx < MAX_SPRITES, "Tried getting sprite %u", sprite_idx);
|
||||
if (sprite_idx >= MAX_SPRITES)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
return &_spriteList[sprite_idx];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user