GLX: don't crash when indirect clients try to set an event mask
authorJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 3 May 2011 17:20:14 +0000 (10:20 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 4 May 2011 21:08:48 +0000 (14:08 -0700)
After sending the GLXChangeDrawableAttributes request, we also set a
local set of attributes on the DRI drawable.  But in the indirect case
this array won't be present, so skip the setting in that case to avoid a
crash.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
src/glx/glx_pbuffer.c

index 5f91bc623a971309ff27b57846f2777f23dec628..ec54f1e09d61a35516f3579657b3f120ea0c6a3b 100644 (file)
@@ -137,6 +137,9 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
 #ifdef GLX_DIRECT_RENDERING
    pdraw = GetGLXDRIDrawable(dpy, drawable);
 
+   if (!pdraw)
+      return;
+
    for (i = 0; i < num_attribs; i++) {
       switch(attribs[i * 2]) {
       case GLX_EVENT_MASK: