diff --git a/sources/Parser/ParserYaml.cpp b/sources/Parser/ParserYaml.cpp index e5918824..032f0025 100644 --- a/sources/Parser/ParserYaml.cpp +++ b/sources/Parser/ParserYaml.cpp @@ -362,6 +362,8 @@ namespace BBM { int block = 0; if (!Utils::tryParse(blockType, block)) throw (ParserError("Couldn't parse block type.")); + if (block < 0 || block > 7) + throw (ParserError("Couldn't parse block type.")); return (static_cast(block)); } @@ -372,6 +374,8 @@ namespace BBM { int bonus = 0; if (!Utils::tryParse(bonusType, bonus)) throw (ParserError("Couldn't parse bonus type.")); + if (bonus < 0 || bonus > 4) + throw (ParserError("Couldn't parse bonus type.")); return (static_cast(bonus)); }