forked from rosebudai/OpenRCT2-Web
Prevent possible stack overflow if zoom offset is 0
This commit is contained in:
1 parent
76d761c299
commit
e13d6da81f
1 file changed
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user