aboutsummaryrefslogtreecommitdiff
path: root/libXext
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-01-20 17:37:27 +0100
committermarha <marha@users.sourceforge.net>2014-01-20 17:37:27 +0100
commit775780ea274e6602c2d64de33a98ee35979cc330 (patch)
tree579a090dd01b5b2b48b4c7359fe1a3c3a2c033bb /libXext
parent4f12e5d53c8a349320883b093c19d91874f9f46a (diff)
downloadvcxsrv-775780ea274e6602c2d64de33a98ee35979cc330.tar.gz
vcxsrv-775780ea274e6602c2d64de33a98ee35979cc330.tar.bz2
vcxsrv-775780ea274e6602c2d64de33a98ee35979cc330.zip
ligXext mesa git update 20 Jan 2014
libXext commit d5447c0156f556114dbf97d6064c0c7b0fcd5f70 mesa commit 799abb271a248f646faa5cc859968f8c71e1ef16
Diffstat (limited to 'libXext')
-rw-r--r--libXext/src/Xge.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/libXext/src/Xge.c b/libXext/src/Xge.c
index 1f37e596d..5c4d72dd7 100644
--- a/libXext/src/Xge.c
+++ b/libXext/src/Xge.c
@@ -108,15 +108,21 @@ static XExtDisplayInfo *_xgeFindDisplay(Display *dpy)
&xge_extension_hooks,
0 /* no events, see below */,
NULL);
- /* We don't use an extension opcode, so we have to set the handlers
- * directly. If GenericEvent would be > 64, the job would be done by
- * XExtAddDisplay */
- XESetWireToEvent (dpy,
- GenericEvent,
- xge_extension_hooks.wire_to_event);
- XESetEventToWire (dpy,
- GenericEvent,
- xge_extension_hooks.event_to_wire);
+ /* dpyinfo->codes is only null if the server claims not to suppport
+ XGE. Don't set up the hooks then, so that an XGE event from the
+ server doesn't crash our client */
+ if (dpyinfo && dpyinfo->codes)
+ {
+ /* We don't use an extension opcode, so we have to set the handlers
+ * directly. If GenericEvent would be > 64, the job would be done by
+ * XExtAddDisplay */
+ XESetWireToEvent (dpy,
+ GenericEvent,
+ xge_extension_hooks.wire_to_event);
+ XESetEventToWire (dpy,
+ GenericEvent,
+ xge_extension_hooks.event_to_wire);
+ }
}
return dpyinfo;
}
@@ -238,7 +244,7 @@ _xgeWireToEvent(Display* dpy, XEvent* re, xEvent *event)
int extension;
XGEExtList it;
XExtDisplayInfo* info = _xgeFindDisplay(dpy);
- if (!info)
+ if (!info || !info->data)
return False;
/*
_xgeCheckExtInit() calls LockDisplay, leading to a SIGABRT.
@@ -274,7 +280,7 @@ _xgeEventToWire(Display* dpy, XEvent* re, xEvent* event)
int extension;
XGEExtList it;
XExtDisplayInfo* info = _xgeFindDisplay(dpy);
- if (!info)
+ if (!info || !info->data)
return 1; /* error! */
extension = ((XGenericEvent*)re)->extension;