summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 51abf86072a..f5240455329 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1062,6 +1062,15 @@ _mesa_init_constants( GLcontext *ctx )
ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES;
ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH;
+ /* If we're running in the X server, do bounds checking to prevent
+ * segfaults and server crashes!
+ */
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ ctx->Const.CheckArrayBounds = GL_TRUE;
+#else
+ ctx->Const.CheckArrayBounds = GL_FALSE;
+#endif
+
ASSERT(ctx->Const.MaxTextureUnits == MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits));
}