From 8d6ae49a8b18ad8006ff8f22caf06bad83b96e6b Mon Sep 17 00:00:00 2001 From: Anuj Phogat Date: Tue, 3 Feb 2015 17:04:45 -0800 Subject: meta: Add assertion check for ctx->Meta->SaveStackDepth before using it for derefrencing. Signed-off-by: Anuj Phogat Reviewed-by: Neil Roberts --- src/mesa/drivers/common/meta.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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; -- cgit v1.2.3