summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2015-02-03 17:04:45 -0800
committerAnuj Phogat <[email protected]>2015-02-25 14:10:59 -0800
commit8d6ae49a8b18ad8006ff8f22caf06bad83b96e6b (patch)
tree8a8cbce38c56ac237603ed373a96dca28a9abd35 /src/mesa/drivers/common
parent0a4ea87344a1cbca4c50cfca1efe97202aa18be8 (diff)
meta: Add assertion check for ctx->Meta->SaveStackDepth
before using it for derefrencing. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Neil Roberts <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common')
-rw-r--r--src/mesa/drivers/common/meta.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index dabf9345bb0..fdc4cf1e927 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -823,6 +823,8 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
void
_mesa_meta_end(struct gl_context *ctx)
{
+ assert(ctx->Meta->SaveStackDepth > 0);
+
struct save_state *save = &ctx->Meta->Save[ctx->Meta->SaveStackDepth - 1];
const GLbitfield state = save->SavedState;
int i;