From bd784fabaa107c1088929b6b718cbea258c730db Mon Sep 17 00:00:00 2001 From: cignoni Date: Sat, 14 Jun 2008 07:29:31 +0000 Subject: [PATCH] Corrected a small bug in the management of negative indexes of obj on non triangular faces --- wrap/io_trimesh/import_obj.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wrap/io_trimesh/import_obj.h b/wrap/io_trimesh/import_obj.h index 6fb94f94..a1b6a9a9 100644 --- a/wrap/io_trimesh/import_obj.h +++ b/wrap/io_trimesh/import_obj.h @@ -442,20 +442,20 @@ static int Open( OpenMeshType &m, const char * filename, Info &oi) while (iVertex < vertexesPerFace) // add other triangles { ObjIndexedFace ffNew=ff; - int v4_index; + int v4_index; int vt4_index; int vn4_index; - SplitToken(tokens[++iVertex], v4_index, vn4_index, vt4_index, oi.mask); - + SplitToken(tokens[++iVertex], v4_index, vn4_index, vt4_index, oi.mask); + if(!GoodObjIndex(v4_index, numVertices)) + return E_BAD_VERT_INDEX; + // assigning wedge texture coordinates // ----------------------------------- if( oi.mask & vcg::tri::io::Mask::IOM_WEDGTEXCOORD ) { // verifying validity of texture coords index // ------------------------------------------ - if(!GoodObjIndex(v4_index, numVertices)) - return E_BAD_VERT_INDEX; if(!GoodObjIndex(vt4_index,oi.numTexCoords)) return E_BAD_VERT_TEX_INDEX;