Mesa (master): GLX: don' t crash when indirect clients try to set an event mask

Jesse Barnes jbarnes at kemper.freedesktop.org
Wed May 4 21:17:48 UTC 2011


Module: Mesa
Branch: master
Commit: 6ae9e8cbabdc8a18a821ea3f716b18b3eb82a495
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6ae9e8cbabdc8a18a821ea3f716b18b3eb82a495

Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date:   Tue May  3 10:20:14 2011 -0700

GLX: don't crash when indirect clients try to set an event mask

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 at redhat.com>
Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>

---

 src/glx/glx_pbuffer.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index 5f91bc6..ec54f1e 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -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:




More information about the mesa-commit mailing list