Commit 7be0e00b authored by Jan Möbius's avatar Jan Möbius
Browse files

Fixed crash with wron indices in obj importer

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11430 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e5322b35
......@@ -237,8 +237,11 @@ void OBJImporter::addUsedVertices(){
//add all vertices to the mesh
std::set<VertexHandle>::iterator it;
// Clear the map of already existing vertices
vertexMapTri_.clear();
for ( it=usedVertices_[ currentObject() ].begin() ; it != usedVertices_[ currentObject() ].end(); it++ ){
if ( *it >= (int)vertices_.size() ){
std::cerr << "Error: Vertex ID too large" << std::endl;
continue;
......@@ -256,6 +259,9 @@ void OBJImporter::addUsedVertices(){
//add all vertices to the mesh
std::set<VertexHandle>::iterator it;
// Clear the map of already existing vertices
vertexMapPoly_.clear();
for ( it=usedVertices_[ currentObject() ].begin() ; it != usedVertices_[ currentObject() ].end(); it++ ){
if ( *it >= (int)vertices_.size() ){
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment