summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/light.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 7bc22e2fa54..38ec1b6e801 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -728,6 +728,8 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
_mesa_lookup_enum_by_nr(mode));
bitmask = _mesa_material_bitmask(ctx, face, mode, legal, "glColorMaterial");
+ if (bitmask == 0)
+ return; /* error was recorded */
if (ctx->Light.ColorMaterialBitmask == bitmask &&
ctx->Light.ColorMaterialFace == face &&