diff options
-rw-r--r-- | src/tileset.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tileset.c b/src/tileset.c index f1b7e36..d8b3c03 100644 --- a/src/tileset.c +++ b/src/tileset.c @@ -312,6 +312,11 @@ _db_tsx_tileset_start(void *pv, const char *name, const char **attr) return; } db_xml_get_int_attr(p, attr, "tilecount", &tileset->tc, 1); + if (tileset->tc > 32) { + db_err("Tileset may not have more than 32 tiles"); + XML_StopParser(p, XML_FALSE); + return; + } db_xml_get_int_attr(p, attr, "columns", &tileset->cols, 1); db_dbg(" Tile size: %dx%d px", tileset->tw, tileset->th); |