From 17cb01c7379fb8c423977995df347ba6beac96cc Mon Sep 17 00:00:00 2001 From: Martijn Versteegh Date: Sat, 17 Nov 2018 20:24:40 +0100 Subject: [PATCH] Fix crash if the total map size is smaller than the tile size; --- TileGenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TileGenerator.cpp b/TileGenerator.cpp index e2ab7e4..362f845 100644 --- a/TileGenerator.cpp +++ b/TileGenerator.cpp @@ -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;