aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-09-22 15:20:09 +0200
committermarha <marha@users.sourceforge.net>2011-09-22 15:20:09 +0200
commitc1e6c7428a8d2c1b60ffac7df7a3f56c300fa983 (patch)
tree8874978d314129a4f47ee575b076c2d8eb1a8738 /mesalib/src/mesa/vbo/vbo_attrib_tmp.h
parent37466741e35c5eb3b204863a5023bf8d192efc06 (diff)
downloadvcxsrv-c1e6c7428a8d2c1b60ffac7df7a3f56c300fa983.tar.gz
vcxsrv-c1e6c7428a8d2c1b60ffac7df7a3f56c300fa983.tar.bz2
vcxsrv-c1e6c7428a8d2c1b60ffac7df7a3f56c300fa983.zip
libxtrans libX11 libX11 libXext mesa xserver git update 22 sep 2011
Diffstat (limited to 'mesalib/src/mesa/vbo/vbo_attrib_tmp.h')
-rw-r--r--mesalib/src/mesa/vbo/vbo_attrib_tmp.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
index 65717eb45..e1023834a 100644
--- a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
+++ b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
@@ -809,6 +809,12 @@ TAG(Materialfv)(GLenum face, GLenum pname,
const GLfloat * params)
{
GET_CURRENT_CONTEXT(ctx);
+
+ if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glMaterial(invalid face)");
+ return;
+ }
+
switch (pname) {
case GL_EMISSION:
MAT(VBO_ATTRIB_MAT_FRONT_EMISSION, 4, face, params);
@@ -823,7 +829,12 @@ TAG(Materialfv)(GLenum face, GLenum pname,
MAT(VBO_ATTRIB_MAT_FRONT_SPECULAR, 4, face, params);
break;
case GL_SHININESS:
- MAT(VBO_ATTRIB_MAT_FRONT_SHININESS, 1, face, params);
+ if (*params < 0 || *params > ctx->Const.MaxShininess)
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glMaterial(invalid shininess: %f out range [0, %f])",
+ *params, ctx->Const.MaxShininess);
+ else
+ MAT(VBO_ATTRIB_MAT_FRONT_SHININESS, 1, face, params);
break;
case GL_COLOR_INDEXES:
MAT(VBO_ATTRIB_MAT_FRONT_INDEXES, 3, face, params);