diff options
author | Ian Romanick <[email protected]> | 2012-07-27 16:07:19 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-08-29 15:09:35 -0700 |
commit | fb4f2d34256aee6b0005b18769a395dd066d3820 (patch) | |
tree | 610f616cbe0f528eed4ebbe280f9d4780fcdf4a1 /src/mesa/vbo/vbo_exec_api.c | |
parent | 8df3f9bd5f7626a4548e9901c0b7af33a21af8a6 (diff) |
mesa/es: Validate glMaterial face and pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_exec_api.c')
-rw-r--r-- | src/mesa/vbo/vbo_exec_api.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index fc7e4069232..a97f8d7f3b4 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -457,10 +457,10 @@ vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params) updateMats = ALL_MATERIAL_BITS; } - if (face == GL_FRONT) { + if (ctx->API == API_OPENGL && face == GL_FRONT) { updateMats &= FRONT_MATERIAL_BITS; } - else if (face == GL_BACK) { + else if (ctx->API == API_OPENGL && face == GL_BACK) { updateMats &= BACK_MATERIAL_BITS; } else if (face != GL_FRONT_AND_BACK) { @@ -506,6 +506,10 @@ vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params) MAT_ATTR(VBO_ATTRIB_MAT_BACK_SHININESS, 1, params); break; case GL_COLOR_INDEXES: + if (ctx->API != API_OPENGL) { + _mesa_error(ctx, GL_INVALID_ENUM, "glMaterialfv(pname)"); + return; + } if (updateMats & MAT_BIT_FRONT_INDEXES) MAT_ATTR(VBO_ATTRIB_MAT_FRONT_INDEXES, 3, params); if (updateMats & MAT_BIT_BACK_INDEXES) |