You've already forked OpenRCT2-Unity
mirror of
https://github.com/izzy2lost/OpenRCT2-Unity.git
synced 2026-03-10 12:38:22 -07:00
Merge pull request #15475 from ZehMatt/fix/spatial-overflow
Fix out of bounds access
This commit is contained in:
@@ -55,7 +55,7 @@ constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y)
|
||||
const auto tileY = std::clamp<size_t>(y / COORDS_XY_STEP, 0, MAXIMUM_MAP_SIZE_TECHNICAL);
|
||||
const auto index = tileX * MAXIMUM_MAP_SIZE_TECHNICAL + tileY;
|
||||
|
||||
if (index >= sizeof(gSpriteSpatialIndex))
|
||||
if (index >= std::size(gSpriteSpatialIndex))
|
||||
{
|
||||
return SPATIAL_INDEX_LOCATION_NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user