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
This commit is contained in:
Kim Kulling
2022-01-20 10:25:52 +01:00
committed by GitHub
parent 985a5b9667
commit c1968823ad

View File

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