aboutsummaryrefslogtreecommitdiff
path: root/libXext/src
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-01-20 17:47:31 +0100
committermarha <marha@users.sourceforge.net>2014-01-20 17:47:31 +0100
commit78d84bd03c744b0ed420c450dd2807904ccaef21 (patch)
tree5047a42b383693eed77091fb86950c6248681ad9 /libXext/src
parent1917325d5254a9ca33dae8ee5817dfdb7be5a24a (diff)
parent775780ea274e6602c2d64de33a98ee35979cc330 (diff)
downloadvcxsrv-78d84bd03c744b0ed420c450dd2807904ccaef21.tar.gz
vcxsrv-78d84bd03c744b0ed420c450dd2807904ccaef21.tar.bz2
vcxsrv-78d84bd03c744b0ed420c450dd2807904ccaef21.zip
Merge remote-tracking branch 'origin/released'
* origin/released: ligXext mesa git update 20 Jan 2014 fontconfig mesa git update 19 Jan 2013 Conflicts: mesalib/src/loader/Android.mk mesalib/src/loader/Makefile.am mesalib/src/loader/SConscript mesalib/src/loader/loader.c tools/mhmake/config.guess
Diffstat (limited to 'libXext/src')
-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;