summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 4c5f9dce5e4..f23673a6cdc 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -209,6 +209,8 @@ enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit)
{
struct gl_fixedfunc_texture_unit *texUnit =
_mesa_get_current_fixedfunc_tex_unit(ctx);
+ if (!texUnit)
+ return GL_FALSE;
const GLbitfield newenabled = state
? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit);
@@ -1293,6 +1295,9 @@ is_texture_enabled(struct gl_context *ctx, GLbitfield bit)
const struct gl_fixedfunc_texture_unit *const texUnit =
_mesa_get_current_fixedfunc_tex_unit(ctx);
+ if (!texUnit)
+ return GL_FALSE;
+
return (texUnit->Enabled & bit) ? GL_TRUE : GL_FALSE;
}