Revision
218
Author
gstaplin@apple.com
Date
2009-02-21 01:50:25 -0800 (Sat, 21 Feb 2009)

Log Message

Avoid a fault when creating the XError for the case of a NULL GLXContext in glXIsDirect.

Modified Paths

Diff

Modified: AppleSGLX/trunk/glxcmds.c (217 => 218)


--- AppleSGLX/trunk/glxcmds.c	2009-02-21 00:17:45 UTC (rev 217)
+++ AppleSGLX/trunk/glxcmds.c	2009-02-21 09:50:25 UTC (rev 218)
@@ -605,13 +605,17 @@
     xError error;
 
     if(NULL == gc) {
+	/*
+	 * This isn't an ideal test.  
+	 * glXIsDirect should probably search a list of contexts.
+	 */
 	LockDisplay(dpy);
 	
 	error.errorCode = GLXBadContext;
 	error.resourceID = 0;
 	error.sequenceNumber = dpy->request;
 	error.type = X_Error;
-	error.majorCode = gc->majorOpcode;
+	error.majorCode = 0; //gc->majorOpcode;
 	error.minorCode = X_GLXIsDirect;
 	_XError(dpy, &error);