Mesa (master): mesa: fix/add error check in _mesa_ColorMaterial()
Brian Paul
brianp at kemper.freedesktop.org
Fri May 11 22:19:05 UTC 2012
Module: Mesa
Branch: master
Commit: f2724905469bbcde820b9ece2e4f44a610a75a65
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f2724905469bbcde820b9ece2e4f44a610a75a65
Author: Brian Paul <brianp at vmware.com>
Date: Tue May 8 10:22:20 2012 -0600
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 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 &&
More information about the mesa-commit
mailing list