1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

Fix invalid bounds check in game_command_set_staff_order

This commit is contained in:
Michał Janiszewski
2017-02-17 08:36:34 +01:00
parent 31ef90fafb
commit 03dd026ba0

View File

@@ -406,7 +406,7 @@ void game_command_set_staff_order(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32
if(order_id & 0x80){ // change costume
uint8 sprite_type = order_id & ~0x80;
sprite_type += 4;
if (sprite_type > countof(peep_slow_walking_types)) {
if (sprite_type >= countof(peep_slow_walking_types)) {
log_error("Invalid change costume order for sprite_type %u", sprite_type);
*ebx = MONEY32_UNDEFINED;
return;