From 4c44513d4ff42d6114a3c16441f60ad50f9d6b01 Mon Sep 17 00:00:00 2001 From: cignoni Date: Sun, 22 Apr 2012 09:01:04 +0000 Subject: [PATCH] corrected bug in the UpdateTopology::EdgeEdge function: it touched a vector element beyond .end() --- vcg/complex/algorithms/update/topology.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vcg/complex/algorithms/update/topology.h b/vcg/complex/algorithms/update/topology.h index 2f228963..e1c86ee6 100644 --- a/vcg/complex/algorithms/update/topology.h +++ b/vcg/complex/algorithms/update/topology.h @@ -467,10 +467,12 @@ static void EdgeEdge(MeshType &m) int ne = 0; // Numero di edge reali typename std::vector::iterator pe,ps; - for(ps = v.begin(),pe=v.begin();pe<=v.end();++pe) // Scansione vettore ausiliario + // for(ps = v.begin(),pe=v.begin();pe<=v.end();++pe) // Scansione vettore ausiliario + ps = v.begin();pe=v.begin(); + do { // printf("v %i -> e %i\n",tri::Index(m,(*ps).v),tri::Index(m,(*ps).e)); - if( pe==v.end() || *pe != *ps ) // Trovo blocco di edge uguali + if( pe==v.end() || !(*pe == *ps) ) // Trovo blocco di edge uguali { typename std::vector::iterator q,q_next; for (q=ps;q