aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/vbo
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-09-22 15:42:49 +0200
committermarha <marha@users.sourceforge.net>2011-09-22 15:42:49 +0200
commit46d4f558531910ca1f3297da85b99334d6de2921 (patch)
tree60c37077eb160948fe317a17ec4c19bef679aa35 /mesalib/src/mesa/vbo
parent0bf6df93b9fdbb7902bf1014d605c6876a3ad035 (diff)
parentc1e6c7428a8d2c1b60ffac7df7a3f56c300fa983 (diff)
downloadvcxsrv-46d4f558531910ca1f3297da85b99334d6de2921.tar.gz
vcxsrv-46d4f558531910ca1f3297da85b99334d6de2921.tar.bz2
vcxsrv-46d4f558531910ca1f3297da85b99334d6de2921.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/Xext/dpms.c xorg-server/Xext/saver.c xorg-server/Xext/security.c xorg-server/Xext/shape.c xorg-server/Xext/sync.c xorg-server/Xi/opendev.c xorg-server/fb/wfbrename.h xorg-server/glx/glxserver.h xorg-server/hw/xwin/winwindowswm.c xorg-server/mi/miarc.c xorg-server/mi/miwideline.c xorg-server/os/io.c xorg-server/render/mipict.c
Diffstat (limited to 'mesalib/src/mesa/vbo')
-rw-r--r--mesalib/src/mesa/vbo/vbo_attrib_tmp.h13
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_api.c7
2 files changed, 19 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);
diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c
index cad7c4639..150589bec 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_api.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_api.c
@@ -42,6 +42,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/light.h"
#include "main/api_arrayelt.h"
#include "main/api_noop.h"
+#include "main/api_validate.h"
#include "main/dispatch.h"
#include "vbo_context.h"
@@ -552,6 +553,7 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j )
#endif /* FEATURE_evaluators */
+
/**
* Called via glBegin.
*/
@@ -563,6 +565,11 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode )
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
int i;
+ if (!_mesa_valid_prim_mode(ctx, mode)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBegin");
+ return;
+ }
+
if (ctx->NewState) {
_mesa_update_state( ctx );