Merge pull request #4502 from assimp/kimkulling/out_of_range_access_error_issue4495

Fix out-of-range access in ASE-Parser
pull/4507/head
Kim Kulling 2022-04-27 20:33:06 +02:00 committed by GitHub
commit 66cfe0cdf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -646,10 +646,13 @@ void Parser::ParseLV2MaterialBlock(ASE::Material &mat) {
} }
// get a reference to the material // get a reference to the material
if (iIndex < mat.avSubMaterials.size()) {
Material &sMat = mat.avSubMaterials[iIndex]; Material &sMat = mat.avSubMaterials[iIndex];
// parse the material block // parse the material block
ParseLV2MaterialBlock(sMat); ParseLV2MaterialBlock(sMat);
}
continue; continue;
} }
} }