summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-13 20:35:32 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-13 20:35:32 +0100
commitc2d2d078724fb579552717aa45f67e835cf47c7a (patch)
treea7c301b58c4cbb3526338751615aa33ed842c1d2 /src
parentfa386ee328dae882a9715fc5dece7d75ccd168ec (diff)
downloadmana-c2d2d078724fb579552717aa45f67e835cf47c7a.tar.gz
mana-c2d2d078724fb579552717aa45f67e835cf47c7a.tar.bz2
mana-c2d2d078724fb579552717aa45f67e835cf47c7a.tar.xz
mana-c2d2d078724fb579552717aa45f67e835cf47c7a.zip
Fixed crash when map layer has too many tiles.
(cherry picked from eAthena client)
Diffstat (limited to 'src')
-rw-r--r--src/resources/mapreader.cpp8
1 files changed, 7 insertions, 1 deletions
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);
}