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::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"); }