Forráskód Böngészése

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
Kim Kulling 3 éve
szülő
commit
c1968823ad
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      code/AssetLib/ASE/ASEParser.cpp

+ 2 - 1
code/AssetLib/ASE/ASEParser.cpp

@@ -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