summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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");
}