Revision: 69120
          http://sourceforge.net/p/brlcad/code/69120
Author:   brlcad
Date:     2016-10-18 16:24:15 +0000 (Tue, 18 Oct 2016)
Log Message:
-----------
two uninitialized var cases caught by the compiler.  need more familiar eyes on 
this.

Modified Paths:
--------------
    brlcad/trunk/src/libanalyze/MeshHealing/MeshConversion_brlcad.cpp
    brlcad/trunk/src/libanalyze/MeshHealing/Zipper.cpp

Modified: brlcad/trunk/src/libanalyze/MeshHealing/MeshConversion_brlcad.cpp
===================================================================
--- brlcad/trunk/src/libanalyze/MeshHealing/MeshConversion_brlcad.cpp   
2016-10-18 16:16:00 UTC (rev 69119)
+++ brlcad/trunk/src/libanalyze/MeshHealing/MeshConversion_brlcad.cpp   
2016-10-18 16:24:15 UTC (rev 69120)
@@ -313,6 +313,8 @@
                }
            }
        } else {
+
+           third_vertex = -1;
            for (unsigned int j = 0; j < VERTICES_PER_FACE; j++) {
 
                /*Finding the third vertex, that is one that is not vertex1 or 
vertex2 */
@@ -323,7 +325,8 @@
            }
 
            /* Finding the edge_id of the edge from vertex2 to third_vertex */
-           edgelist[i].next = getEdge(std::make_pair(vertex2, third_vertex));
+           if (third_vertex != -1)
+               edgelist[i].next = getEdge(std::make_pair(vertex2, 
third_vertex));
        }
     }
 }

Modified: brlcad/trunk/src/libanalyze/MeshHealing/Zipper.cpp
===================================================================
--- brlcad/trunk/src/libanalyze/MeshHealing/Zipper.cpp  2016-10-18 16:16:00 UTC 
(rev 69119)
+++ brlcad/trunk/src/libanalyze/MeshHealing/Zipper.cpp  2016-10-18 16:24:15 UTC 
(rev 69120)
@@ -102,7 +102,7 @@
     /* If it is a triangular hole, perform vertex contraction on the two 
closest vertices */
     if (no_of_sides == 3) {
 
-       DCEL_Edge *temp = start, *feature;
+       DCEL_Edge *temp = start, *feature = NULL;
        int min_dist = INT_MAX;
 
        for(int i = 0; i < 3; i++) {
@@ -115,6 +115,9 @@
            temp = temp->next;
        }
 
+       if (!feature)
+           return PQ;
+
        node.vertex = feature->previous->origin;
        node.feature_edge = feature;
        node.feature_vertex = NULL;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to