[Xquartz-changes] [262] AppleSGLX/trunk/apple_glx_context.c

source_changes at macosforge.org source_changes at macosforge.org
Wed Feb 25 23:49:48 PST 2009


Revision: 262
          http://trac.macosforge.org/projects/xquartz/changeset/262
Author:   gstaplin at apple.com
Date:     2009-02-25 23:49:45 -0800 (Wed, 25 Feb 2009)
Log Message:
-----------
Test if the drawable is the current drawable in a safer way.

Before if the context was new and glXSwapBuffers was called
without a drawable made current, it would likely crash while
dereferencing NULL.  We want it to generate a nice XError
instead.

Modified Paths:
--------------
    AppleSGLX/trunk/apple_glx_context.c

Modified: AppleSGLX/trunk/apple_glx_context.c
===================================================================
--- AppleSGLX/trunk/apple_glx_context.c	2009-02-26 07:12:59 UTC (rev 261)
+++ AppleSGLX/trunk/apple_glx_context.c	2009-02-26 07:49:45 UTC (rev 262)
@@ -489,7 +489,7 @@
 
     assert(NULL != ac);
     
-    return (ac->drawable->drawable == drawable);
+    return (ac->drawable && ac->drawable->drawable == drawable);
 }
 
 /* Return true if an error occurred. */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/xquartz-changes/attachments/20090225/a657ca96/attachment.html>


More information about the Xquartz-changes mailing list