dri: Rework planar image interface
[mesa.git] / src / glu / sgi / libnurbs / nurbtess / monoTriangulation.cc
index e7e19437b142b235306bb2d26c27d6743371020a..8e8d49dda7053dbd710b86dbdc52d504109bb840 100644 (file)
 ** published by SGI, but has not been independently verified as being
 ** compliant with the OpenGL(R) version 1.2.1 Specification.
 **
-** $Date: 2004/05/12 15:29:36 $ $Revision: 1.3 $
 */
 /*
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc,v 1.3 2004/05/12 15:29:36 brianp Exp $
 */
 
 #include <stdlib.h>
@@ -619,8 +617,10 @@ void monoTriangulationFun(directedLine* monoPolygon, Int (*compFun)(Real*, Real*
     dec_chain.appendVertex(tempV->getVertex(i));
   }
   
-  monoTriangulationRecFun(topV->head(), botV->head(), &inc_chain, 0, &dec_chain, 0, compFun, pStream);
-
+  if (!(0 == inc_chain.getNumElements() && 0 == dec_chain.getNumElements())) {
+     monoTriangulationRecFun(topV->head(), botV->head(), &inc_chain, 0,
+                             &dec_chain, 0, compFun, pStream);
+  }
 }  
 
 void monoTriangulation(directedLine* monoPolygon, primStream* pStream)
@@ -1037,8 +1037,8 @@ void monoTriangulationRec(directedLine* inc_chain, Int inc_index,
                          primStream* pStream)
 {
   Int i;
-  directedLine *temp, *oldtemp;
-  Int tempIndex, oldtempIndex;
+  directedLine *temp, *oldtemp = NULL;
+  Int tempIndex, oldtempIndex = 0;
   
   assert(inc_chain != NULL && dec_chain != NULL);