aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 8876ca2e246..984c9e00bbf 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1208,6 +1208,12 @@ _mesa_initialize_context(struct gl_context *ctx,
if (!init_attrib_groups( ctx ))
goto fail;
+ /* KHR_no_error is likely to crash, overflow memory, etc if an application
+ * has errors so don't enable it for setuid processes.
+ */
+ if (getenv("MESA_NO_ERROR") && geteuid() == getuid())
+ ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR;
+
/* setup the API dispatch tables with all nop functions */
ctx->OutsideBeginEnd = _mesa_alloc_dispatch_table();
if (!ctx->OutsideBeginEnd)