summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-02-03 12:25:28 -0700
committerBrian Paul <[email protected]>2010-02-03 15:48:41 -0700
commit376ae23c3a226399f9f33be716f3990ff4442580 (patch)
treea96b58a339ffcedfd77910f8ac683e60fd819d44 /src
parent7bd949734c96a0af49cb0b89230dc82799c593b7 (diff)
mesa: add out of bounds assertions for accessing texture matrix stack
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/texstate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 2b26f651a54..6f8831dfe03 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -356,6 +356,7 @@ update_texture_matrices( GLcontext *ctx )
ctx->Texture._TexMatEnabled = 0x0;
for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) {
+ ASSERT(u < Elements(ctx->TextureMatrixStack));
if (_math_matrix_is_dirty(ctx->TextureMatrixStack[u].Top)) {
_math_matrix_analyse( ctx->TextureMatrixStack[u].Top );
@@ -627,6 +628,7 @@ update_texture_state( GLcontext *ctx )
ctx->Texture._GenFlags |= texUnit->_GenFlags;
}
+ ASSERT(unit < Elements(ctx->TextureMatrixStack));
if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY)
ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit);
}