Skip to content

Commit 17cb01c

Browse files
Martijn VersteeghMartijn Versteegh
authored andcommitted
Fix crash if the total map size is smaller than the tile size;
1 parent bd0c140 commit 17cb01c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

TileGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,10 @@ void TileGenerator::createImage()
439439
m_mapWidth = (m_xMax - m_xMin + 1);
440440
m_mapHeight = (m_zMax - m_zMin + 1);
441441

442-
if (m_mapWidth > m_tileW)
442+
if (m_mapWidth < INT_MAX)
443443
m_mapWidth = m_tileW;
444444

445-
if (m_mapHeight > m_tileH)
445+
if (m_mapHeight < INT_MAX)
446446
m_mapHeight = m_tileH;
447447

448448
m_mapWidth *= 16;

0 commit comments

Comments
 (0)