summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/x11
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r--src/mesa/drivers/x11/glxapi.c2
-rw-r--r--src/mesa/drivers/x11/xm_api.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c
index 7945f1c5b0..973f394045 100644
--- a/src/mesa/drivers/x11/glxapi.c
+++ b/src/mesa/drivers/x11/glxapi.c
@@ -241,7 +241,7 @@ glXGetCurrentContext(void)
#if defined(GLX_USE_TLS)
return CurrentContext;
#elif defined(THREADS)
- return _glthread_GetTSD(&ContextTSD);
+ return (GLXContext) _glthread_GetTSD(&ContextTSD);
#else
return CurrentContext;
#endif
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 98a68dd4f4..b0ef422de2 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -1545,6 +1545,13 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
_mesa_enable_extension(mesaCtx, "GL_EXT_timer_query");
#endif
+#ifdef XFree86Server
+ /* If we're running in the X server, do bounds checking to prevent
+ * segfaults and server crashes!
+ */
+ mesaCtx->Const.CheckArrayBounds = GL_TRUE;
+#endif
+
/* finish up xmesa context initializations */
c->swapbytes = CHECK_BYTE_ORDER(v) ? GL_FALSE : GL_TRUE;
c->xm_visual = v;