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

Prevent access to invalid banner in game command

This commit is contained in:
Michał Janiszewski
2017-04-26 22:40:04 +02:00
committed by Michał Janiszewski
parent ee4e863dc6
commit dd6e040122

View File

@@ -4424,6 +4424,11 @@ void game_command_set_sign_name(sint32* eax, sint32* ebx, sint32* ecx, sint32* e
void game_command_set_sign_style(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx, sint32* esi, sint32* edi, sint32* ebp) {
uint8 bannerId = *ecx & 0xFF;
if (bannerId > countof(gBanners)) {
log_warning("Invalid game command for setting sign style, banner id = %d", bannerId);
*ebx = MONEY32_UNDEFINED;
return;
}
rct_banner *banner = &gBanners[bannerId];
sint32 x = banner->x << 5;
sint32 y = banner->y << 5;