[Mesa-dev] [PATCH 03/14] meta: Add assertion check for ctx->Meta->SaveStackDepth
Anuj Phogat
anuj.phogat at gmail.com
Mon Feb 23 14:36:40 PST 2015
before using it for derefrencing.
Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
src/mesa/drivers/common/meta.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 3636ee8..65c0934 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;
--
1.9.3
More information about the mesa-dev
mailing list