Module Name:    xsrc
Committed By:   martin
Date:           Mon Feb 16 13:30:46 UTC 2015

Modified Files:
        xsrc/external/mit/glu/dist/src/libtess [netbsd-7]: sweep.c

Log Message:
Pull up following revision(s) (requested by snj in ticket #517):
        external/mit/glu/dist/src/libtess/sweep.c: revision 1.2
Fixes segfaults and crashing in applications that use libGLU.
This commit was approved by wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3 \
    xsrc/external/mit/glu/dist/src/libtess/sweep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/glu/dist/src/libtess/sweep.c
diff -u xsrc/external/mit/glu/dist/src/libtess/sweep.c:1.1.1.1.2.2 xsrc/external/mit/glu/dist/src/libtess/sweep.c:1.1.1.1.2.3
--- xsrc/external/mit/glu/dist/src/libtess/sweep.c:1.1.1.1.2.2	Tue Dec 23 02:55:00 2014
+++ xsrc/external/mit/glu/dist/src/libtess/sweep.c	Mon Feb 16 13:30:46 2015
@@ -546,7 +546,9 @@ static int CheckForRightSplice( GLUtesse
     if( EdgeSign( eUp->Dst, eLo->Org, eUp->Org ) < 0 ) return FALSE;
 
     /* eLo->Org appears to be above eUp, so splice eLo->Org into eUp */
-    RegionAbove(regUp)->dirty = regUp->dirty = TRUE;
+    if (RegionAbove(regUp))
+        RegionAbove(regUp)->dirty = TRUE;
+    regUp->dirty = TRUE;
     if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1);
     if ( !__gl_meshSplice( eLo->Oprev, eUp ) ) longjmp(tess->env,1);
   }
@@ -584,7 +586,9 @@ static int CheckForLeftSplice( GLUtessel
     if( EdgeSign( eUp->Dst, eLo->Dst, eUp->Org ) < 0 ) return FALSE;
 
     /* eLo->Dst is above eUp, so splice eLo->Dst into eUp */
-    RegionAbove(regUp)->dirty = regUp->dirty = TRUE;
+    if (RegionAbove(regUp))
+        RegionAbove(regUp)->dirty = TRUE;
+    regUp->dirty = TRUE;
     e = __gl_meshSplitEdge( eUp );
     if (e == NULL) longjmp(tess->env,1);
     if ( !__gl_meshSplice( eLo->Sym, e ) ) longjmp(tess->env,1);
@@ -718,7 +722,9 @@ static int CheckForIntersect( GLUtessela
      * (and wait for ConnectRightVertex to splice it appropriately).
      */
     if( EdgeSign( dstUp, tess->event, &isect ) >= 0 ) {
-      RegionAbove(regUp)->dirty = regUp->dirty = TRUE;
+      if (RegionAbove(regUp))
+          RegionAbove(regUp)->dirty = TRUE;
+      regUp->dirty = TRUE;
       if (__gl_meshSplitEdge( eUp->Sym ) == NULL) longjmp(tess->env,1);
       eUp->Org->s = tess->event->s;
       eUp->Org->t = tess->event->t;
@@ -753,7 +759,9 @@ static int CheckForIntersect( GLUtessela
      longjmp(tess->env,1);
   }
   GetIntersectData( tess, eUp->Org, orgUp, dstUp, orgLo, dstLo );
-  RegionAbove(regUp)->dirty = regUp->dirty = regLo->dirty = TRUE;
+  if (RegionAbove(regUp))
+      RegionAbove(regUp)->dirty = TRUE;
+  regUp->dirty = regLo->dirty = TRUE;
   return FALSE;
 }
 

Reply via email to