Procházet zdrojové kódy

AC3D: Throw exception when encountering a bad vertex index

Turo Lamminen před 10 roky
rodič
revize
bf5c9413f9
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      code/ACLoader.cpp

+ 4 - 0
code/ACLoader.cpp

@@ -632,6 +632,10 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
 								face.mIndices[1] = cur++;
 								face.mIndices[1] = cur++;
 
 
 								// copy vertex positions
 								// 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];
 								*vertices++ = object.vertices[(*it2).first];
 								
 								
 								// copy texture coordinates 
 								// copy texture coordinates