diff options
Diffstat (limited to 'src/resources')
-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 328b66e0..af3fc0ef 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -407,7 +407,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); } |