summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/rastpos.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index 703b47ec742..be61dc265d1 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -273,6 +273,7 @@ window_pos3f(GLfloat x, GLfloat y, GLfloat z)
{
GLuint texSet;
for (texSet = 0; texSet < ctx->Const.MaxTextureCoordUnits; texSet++) {
+ assert(texSet < Elements(ctx->Current.RasterTexCoords));
COPY_4FV( ctx->Current.RasterTexCoords[texSet],
ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texSet] );
}
@@ -562,7 +563,7 @@ void _mesa_init_rastpos( GLcontext * ctx )
ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterIndex = 1.0;
- for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++)
+ for (i = 0; i < Elements(ctx->Current.RasterTexCoords); i++)
ASSIGN_4V( ctx->Current.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterPosValid = GL_TRUE;
}