summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-26 04:15:25 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-26 04:15:25 +0200
commitf330fffa09dd1cdf9d6e1e42f8705d43d5803e85 (patch)
tree88d0fbdd5b76e911245d5c30ae156857d8259c6a
parent25c60873bc767042d244cc42554da3fd79db0966 (diff)
downloadrpgedit-f330fffa09dd1cdf9d6e1e42f8705d43d5803e85.tar
rpgedit-f330fffa09dd1cdf9d6e1e42f8705d43d5803e85.zip
Test maximum rotation value in map loader
-rw-r--r--src/model/Map.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/model/Map.cpp b/src/model/Map.cpp
index ac0b6ee..ee413cf 100644
--- a/src/model/Map.cpp
+++ b/src/model/Map.cpp
@@ -117,7 +117,7 @@ std::unique_ptr<Map> Map::load(__attribute__((unused)) const std::string &name)
unsigned rot;
char *tile = nullptr;
- if (std::sscanf(line.c_str(), "%c %u %ms", &c, &rot, &tile) != 3) {
+ if (std::sscanf(line.c_str(), "%c %u %ms", &c, &rot, &tile) != 3 || rot >= 4) {
std::free(tile);
throw std::invalid_argument("invalid map file");
}