diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-26 04:15:25 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-26 04:15:25 +0200 |
commit | f330fffa09dd1cdf9d6e1e42f8705d43d5803e85 (patch) | |
tree | 88d0fbdd5b76e911245d5c30ae156857d8259c6a /src/model | |
parent | 25c60873bc767042d244cc42554da3fd79db0966 (diff) | |
download | rpgedit-f330fffa09dd1cdf9d6e1e42f8705d43d5803e85.tar rpgedit-f330fffa09dd1cdf9d6e1e42f8705d43d5803e85.zip |
Test maximum rotation value in map loader
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/Map.cpp | 2 |
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"); } |