mirror of https://github.com/OpenRCT2/OpenRCT2.git
Prevent possible stack overflow if zoom offset is 0
This commit is contained in:
parent
76d761c299
commit
e13d6da81f
|
@ -69,7 +69,7 @@ namespace ObjectJsonHelpers
|
|||
g1 = *orig;
|
||||
g1.offset = (uint8_t*)std::malloc(length);
|
||||
std::memcpy(g1.offset, orig->offset, length);
|
||||
if (g1.flags & G1_FLAG_HAS_ZOOM_SPRITE)
|
||||
if ((g1.flags & G1_FLAG_HAS_ZOOM_SPRITE) && g1.zoomed_offset != 0)
|
||||
{
|
||||
// Fetch image for next zoom level
|
||||
next_zoom = std::make_unique<RequiredImage>((uint32_t)(idx - g1.zoomed_offset), getter);
|
||||
|
|
Loading…
Reference in New Issue