From a545f1ab6d50e044c6e0b2d952af28e6d9059f80 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 May 2009 07:51:35 -0600 Subject: mesa: added some assertions --- src/mesa/shader/arbprogram.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mesa/shader') 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; } -- cgit v1.2.3