summaryrefslogtreecommitdiffstats
path: root/src/glx/glxext.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-11-28 18:31:21 -0800
committerIan Romanick <[email protected]>2011-12-19 14:55:31 -0800
commite4be406f09fcb3756cd0e8dd0539f62bafb1bcca (patch)
tree0014520581e827e96b2bcc9741e0e1ae3d276d1e /src/glx/glxext.c
parenta832aa5ba097253f53983e3f1186b71626d164ae (diff)
glx: Explicitly reject servers that only support GLX 1.0
__glXInitialize calls AllocAndFetchScreenConfigs. AllocAndFetchScreenConfigs unconditionally sends a glXQuerySeverString request to the server. This request is only supported with GLX 1.1 or later, so we were already implicitly incompatible with GLX 1.0 servers. How many more similar bugs lurk in the code that nobody has noticed in years? Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glx/glxext.c')
-rw-r--r--src/glx/glxext.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 8254544d1c0..baa2489fd19 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -836,9 +836,12 @@ __glXInitialize(Display * dpy)
dpyPriv->serverGLXvendor = 0x0;
dpyPriv->serverGLXversion = 0x0;
- /* See if the versions are compatible */
+ /* See if the versions are compatible. This GLX implementation does not
+ * work with servers that only support GLX 1.0.
+ */
if (!QueryVersion(dpy, dpyPriv->majorOpcode,
- &dpyPriv->majorVersion, &dpyPriv->minorVersion)) {
+ &dpyPriv->majorVersion, &dpyPriv->minorVersion)
+ || (dpyPriv->majorVersion == 1 && dpyPriv->minorVersion < 1)) {
Xfree(dpyPriv);
_XUnlockMutex(_Xglobal_lock);
return NULL;
@@ -884,8 +887,7 @@ __glXInitialize(Display * dpy)
return NULL;
}
- if (dpyPriv->majorVersion == 1 && dpyPriv->minorVersion >= 1)
- __glXClientInfo(dpy, dpyPriv->majorOpcode);
+ __glXClientInfo(dpy, dpyPriv->majorOpcode);
/* Grab the lock again and add the dispay private, unless somebody
* beat us to initializing on this display in the meantime. */