mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
Add check to prevent exceeding the maximum number of animations. Probable cause of #2381
This commit is contained in:
@@ -49,6 +49,10 @@ void map_animation_create(int type, int x, int y, int z)
|
||||
{
|
||||
rct_map_animation *aobj = &gAnimatedObjects[0];
|
||||
int numAnimatedObjects = RCT2_GLOBAL(0x0138B580, uint16);
|
||||
if (numAnimatedObjects >= 2000) {
|
||||
log_error("Exceeded the maximum number of animations");
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < numAnimatedObjects; i++, aobj++) {
|
||||
if (aobj->x != x)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user