Skip to content

Commit

Permalink
Fix crash if the total map size is smaller than the tile size;
Browse files Browse the repository at this point in the history
  • Loading branch information
Martijn Versteegh authored and Martijn Versteegh committed Nov 17, 2018
1 parent bd0c140 commit 17cb01c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TileGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,10 @@ void TileGenerator::createImage()
m_mapWidth = (m_xMax - m_xMin + 1);
m_mapHeight = (m_zMax - m_zMin + 1);

if (m_mapWidth > m_tileW)
if (m_mapWidth < INT_MAX)
m_mapWidth = m_tileW;

if (m_mapHeight > m_tileH)
if (m_mapHeight < INT_MAX)
m_mapHeight = m_tileH;

m_mapWidth *= 16;
Expand Down

0 comments on commit 17cb01c

Please sign in to comment.