LWSLoader: Fix out of bounds iterator access

Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38947
Fix #4222
pull/4324/head
Alex Rebert 2022-01-05 15:19:06 -05:00
parent 310c81aaa2
commit b14b34d2b8
No known key found for this signature in database
GPG Key ID: E082090D746F1A81
1 changed files with 2 additions and 2 deletions

View File

@ -537,8 +537,8 @@ void LWSImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
// get file format version and print to log // get file format version and print to log
++it; ++it;
if ((*it).tokens[0].empty()) { if (it == root.children.end() || (*it).tokens[0].empty()) {
ASSIMP_LOG_ERROR("Invalid LWS file detectedm abort import."); ASSIMP_LOG_ERROR("Invalid LWS file detectedm abort import.");
return; return;
} }