Fix integer overflow

pull/5168/head
Alex 2023-07-03 09:11:38 +00:00
parent e4cac7d00b
commit edb8375702
1 changed files with 4 additions and 0 deletions

View File

@ -840,6 +840,10 @@ void SMDImporter::ParseNodeInfo(const char* szCurrent, const char** szCurrentOut
LogErrorNoThrow("Unexpected EOF/EOL while parsing bone index");
SMDI_PARSE_RETURN;
}
if (iBone == UINT_MAX) {
LogErrorNoThrow("Invalid bone number while parsing bone index");
SMDI_PARSE_RETURN;
}
// add our bone to the list
if (iBone >= asBones.size()) {
asBones.resize(iBone+1);