From 5c1886c0c3ef28c0f2204fc927adc11ea304107f Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Wed, 6 Dec 2006 06:54:13 +0200 Subject: [PATCH] Override Const.CheckArrayBounds for Xserver in XMesaCreateContext(). This leaves one last XFree86Server ifdef in Mesa core. --- src/mesa/drivers/x11/xm_api.c | 7 +++++++ src/mesa/main/context.c | 8 +------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index c3739da..baca87f 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1528,6 +1528,13 @@ #if ENABLE_EXT_timer_query _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; diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index b2bd1d8..99f4dc9 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1078,14 +1078,8 @@ #endif 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(XFree86Server) - ctx->Const.CheckArrayBounds = GL_TRUE; -#else + /* CheckArrayBounds is overriden by drivers/x11 for X server */ ctx->Const.CheckArrayBounds = GL_FALSE; -#endif /* GL_ARB_draw_buffers */ ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS; -- 1.4.0-dirty