浏览代码

Fixx out-of-range access in ASE-Parser

- closes https://github.com/assimp/assimp/issues/4495
Kim Kulling 3 年之前
父节点
当前提交
37ec378b60
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      code/AssetLib/ASE/ASEParser.cpp

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

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