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

Merge pull request #11718 from MegaMech/patch-1

Added check to prevent overflow assertion error
This commit is contained in:
Duncan
2020-05-13 07:58:02 +01:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -78,6 +78,15 @@ public:
return res;
}
if (_status >= RIDE_STATUS_COUNT)
{
log_warning("Invalid ride status %u for ride %u", uint32_t(_status), uint32_t(_rideIndex));
res->Error = GA_ERROR::INVALID_PARAMETERS;
res->ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
res->ErrorMessage = STR_NONE;
return res;
}
res->ErrorTitle = _StatusErrorTitles[_status];
ride->FormatNameTo(res->ErrorMessageArgs.data() + 6);
if (_status != ride->status)

View File

@@ -630,6 +630,7 @@ enum
RIDE_STATUS_OPEN,
RIDE_STATUS_TESTING,
RIDE_STATUS_SIMULATING,
RIDE_STATUS_COUNT,
};
enum : uint8_t