tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

foobilard sefaults on startup - libGLU



Hi

With NetBSD-7.99.4 userland I've found that foobillard (pkgsrc/games)
will segfault on startup.

I've since patched libGLU and this fixes the problem but I would like someone 
familiar with libGLU to review it so I may commit it.

Regards,

Nat.

Index: xsrc/external/mit/glu/dist/src/libtess/sweep.c
===================================================================
RCS file: /cvsroot/xsrc/external/mit/glu/dist/src/libtess/sweep.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 sweep.c
--- xsrc/external/mit/glu/dist/src/libtess/sweep.c	16 Dec 2014 06:01:15 
-0000	1.1.1.1
+++ xsrc/external/mit/glu/dist/src/libtess/sweep.c	21 Jan 2015 13:27:55 -0000
@@ -546,7 +546,9 @@
     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 @@
     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 @@
      * (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 @@
      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;
 }
 


Home | Main Index | Thread Index | Old Index