瀏覽代碼

AC3D: Throw exception when encountering a bad vertex index

Turo Lamminen 10 年之前
父節點
當前提交
bf5c9413f9
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      code/ACLoader.cpp

+ 4 - 0
code/ACLoader.cpp

@@ -632,6 +632,10 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
 								face.mIndices[1] = cur++;
 
 								// copy vertex positions
+								if (it2 == (*it).entries.end() ) {
+									throw DeadlyImportError("AC3D: Bad line");
+								}
+								ai_assert((*it2).first < object.vertices.size());
 								*vertices++ = object.vertices[(*it2).first];
 								
 								// copy texture coordinates