summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r--src/mesa/main/varray.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index a6aa9c34b25..234b712f7f2 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -504,7 +504,7 @@ void GLAPIENTRY
_mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr)
{
- const GLboolean normalized = GL_FALSE;
+ GLboolean normalized = GL_FALSE;
GLsizei elementSize;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -532,6 +532,7 @@ _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type,
/* check for valid 'type' and compute StrideB right away */
switch (type) {
case GL_UNSIGNED_BYTE:
+ normalized = GL_TRUE;
elementSize = size * sizeof(GLubyte);
break;
case GL_SHORT:
@@ -870,16 +871,22 @@ _mesa_LockArraysEXT(GLint first, GLsizei count)
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glLockArrays %d %d\n", first, count);
- if (first == 0 && count > 0 &&
- count <= (GLint) ctx->Const.MaxArrayLockSize) {
- ctx->Array.LockFirst = first;
- ctx->Array.LockCount = count;
+ if (first < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glLockArraysEXT(first)" );
+ return;
}
- else {
- ctx->Array.LockFirst = 0;
- ctx->Array.LockCount = 0;
+ if (count <= 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glLockArraysEXT(count)" );
+ return;
+ }
+ if (ctx->Array.LockCount != 0) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glLockArraysEXT(reentry)" );
+ return;
}
+ ctx->Array.LockFirst = first;
+ ctx->Array.LockCount = count;
+
ctx->NewState |= _NEW_ARRAY;
ctx->Array.NewState |= _NEW_ARRAY_ALL;
@@ -897,6 +904,11 @@ _mesa_UnlockArraysEXT( void )
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glUnlockArrays\n");
+ if (ctx->Array.LockCount == 0) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glUnlockArraysEXT(reexit)" );
+ return;
+ }
+
ctx->Array.LockFirst = 0;
ctx->Array.LockCount = 0;
ctx->NewState |= _NEW_ARRAY;