From: Anuj Phogat Date: Wed, 4 Feb 2015 01:04:45 +0000 (-0800) Subject: meta: Add assertion check for ctx->Meta->SaveStackDepth X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8d6ae49a8b18ad8006ff8f22caf06bad83b96e6b;p=mesa.git meta: Add assertion check for ctx->Meta->SaveStackDepth before using it for derefrencing. Signed-off-by: Anuj Phogat Reviewed-by: Neil Roberts --- 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;