From: Brian Paul Date: Tue, 8 May 2012 16:22:20 +0000 (-0600) Subject: mesa: fix/add error check in _mesa_ColorMaterial() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2724905469bbcde820b9ece2e4f44a610a75a65;p=mesa.git 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. --- 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 &&