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/4232pull/4346/head
parent
985a5b9667
commit
c1968823ad
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue