From f2724905469bbcde820b9ece2e4f44a610a75a65 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 8 May 2012 10:22:20 -0600 Subject: [PATCH] mesa: fix/add error check in _mesa_ColorMaterial() _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 file changed, 2 insertions(+) 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 && -- 2.30.2