From c2d2d078724fb579552717aa45f67e835cf47c7a Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 13 Dec 2008 20:35:32 +0100 Subject: Fixed crash when map layer has too many tiles. (cherry picked from eAthena client) --- src/resources/mapreader.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index cec74717..34018022 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -406,7 +406,13 @@ MapReader::readLayer(xmlNodePtr node, Map *map) setTile(map, layer, x, y, gid); x++; - if (x == w) {x = 0; y++;} + if (x == w) { + x = 0; y++; + + // When we're done, don't crash on too much data + if (y == h) + break; + } } free(binData); } -- cgit v1.2.3-70-g09d2