_mesa_material_bitmask() will record a GL error and return 0 if face or mode are illegal. Return early in that case.
NOTE: This is a candidate for the 8.0 branch. --- src/mesa/main/light.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 7bc22e2..38ec1b6 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 && -- 1.7.3.4 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev