ASE: Fix material parsing

- Fuzzer error found when material access get's an out-of-bound access.
- Break parsing when material index gets out of range.
- closes https://github.com/assimp/assimp/issues/4232
pull/4346/head
Kim Kulling 2022-01-20 10:25:52 +01:00 committed by GitHub
parent 985a5b9667
commit c1968823ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -486,8 +486,9 @@ void Parser::ParseLV1MaterialListBlock() {
ParseLV4MeshLong(iIndex); ParseLV4MeshLong(iIndex);
if (iIndex >= iMaterialCount) { if (iIndex >= iMaterialCount) {
LogWarning("Out of range: material index is too large"); LogError("Out of range: material index is too large");
iIndex = iMaterialCount - 1; iIndex = iMaterialCount - 1;
return;
} }
// get a reference to the material // get a reference to the material