summaryrefslogtreecommitdiff
path: root/src/mesa/shader/arbprogram.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/arbprogram.c')
-rw-r--r--src/mesa/shader/arbprogram.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c
index 21c5cfbf99..39136efada 100644
--- a/src/mesa/shader/arbprogram.c
+++ b/src/mesa/shader/arbprogram.c
@@ -254,6 +254,8 @@ _mesa_EnableVertexAttribArrayARB(GLuint index)
return;
}
+ ASSERT(index < Elements(ctx->Array.ArrayObj->VertexAttrib));
+
FLUSH_VERTICES(ctx, _NEW_ARRAY);
ctx->Array.ArrayObj->VertexAttrib[index].Enabled = GL_TRUE;
ctx->Array.ArrayObj->_Enabled |= _NEW_ARRAY_ATTRIB(index);
@@ -273,6 +275,8 @@ _mesa_DisableVertexAttribArrayARB(GLuint index)
return;
}
+ ASSERT(index < Elements(ctx->Array.ArrayObj->VertexAttrib));
+
FLUSH_VERTICES(ctx, _NEW_ARRAY);
ctx->Array.ArrayObj->VertexAttrib[index].Enabled = GL_FALSE;
ctx->Array.ArrayObj->_Enabled &= ~_NEW_ARRAY_ATTRIB(index);
@@ -315,6 +319,8 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params)
return;
}
+ ASSERT(index < Elements(ctx->Array.ArrayObj->VertexAttrib));
+
array = &ctx->Array.ArrayObj->VertexAttrib[index];
switch (pname) {
@@ -387,6 +393,8 @@ _mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer)
return;
}
+ ASSERT(index < Elements(ctx->Array.ArrayObj->VertexAttrib));
+
*pointer = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[index].Ptr;
}