AC3D: Throw exception on too many vertices instead of crashing

pull/523/head
Turo Lamminen 2015-04-01 16:22:06 +03:00
parent 3e728e80eb
commit 16c57ab1d3
1 changed files with 3 additions and 0 deletions

View File

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