diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-12-13 20:35:32 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-12-13 20:35:32 +0100 |
commit | c2d2d078724fb579552717aa45f67e835cf47c7a (patch) | |
tree | a7c301b58c4cbb3526338751615aa33ed842c1d2 /src | |
parent | fa386ee328dae882a9715fc5dece7d75ccd168ec (diff) | |
download | mana-client-c2d2d078724fb579552717aa45f67e835cf47c7a.tar.gz mana-client-c2d2d078724fb579552717aa45f67e835cf47c7a.tar.bz2 mana-client-c2d2d078724fb579552717aa45f67e835cf47c7a.tar.xz mana-client-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.cpp | 8 |
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); } |