Fix crash if the total map size is smaller than the tile size;

This commit is contained in:
Martijn Versteegh 2018-11-17 20:24:40 +01:00
parent fe5ba54fc9
commit d41e6448ce
1 changed files with 2 additions and 2 deletions

View File

@ -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_tileW < INT_MAX)
m_mapWidth = m_tileW;
if (m_mapHeight > m_tileH)
if (m_tileH < INT_MAX)
m_mapHeight = m_tileH;
m_mapWidth *= 16;