浏览代码

AC3D: Throw exception on too many vertices instead of crashing

Turo Lamminen 10 年之前
父节点
当前提交
16c57ab1d3
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      code/ACLoader.cpp

+ 3 - 0
code/ACLoader.cpp

@@ -598,6 +598,9 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
 									face.mIndices[i] = cur++;
 
 									// copy vertex positions
+									if ((vertices - mesh->mVertices) >= mesh->mNumVertices) {
+										throw DeadlyImportError("AC3D: Invalid number of vertices");
+									}
 									*vertices = object.vertices[entry.first] + object.translation;