Revision
191
Author
gstaplin@apple.com
Date
2009-02-19 19:51:10 -0800 (Thu, 19 Feb 2009)

Log Message

Avoid a crash if the previous current context was NULL, 
and the new current context is NULL, by avoiding the 
dereference of a NULL pointer.

Modified Paths

Diff

Modified: AppleSGLX/trunk/glxcurrent.c (190 => 191)


--- AppleSGLX/trunk/glxcurrent.c	2009-02-20 03:41:00 UTC (rev 190)
+++ AppleSGLX/trunk/glxcurrent.c	2009-02-20 03:51:10 UTC (rev 191)
@@ -152,8 +152,10 @@
 	 * cannot be NULL, therefore if they are the same, gc is not
 	 * NULL and not the dummy.
 	 */
-	gc->currentDrawable = draw;
-	gc->currentReadable = read;
+	if(gc) {
+	    gc->currentDrawable = draw;
+	    gc->currentReadable = read;
+	}
     } else {
 	
 	if (oldGC != &dummyContext) {