meta: Add assertion check for ctx->Meta->SaveStackDepth

before using it for derefrencing.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Anuj Phogat
2015-02-03 17:04:45 -08:00
parent 0a4ea87344
commit 8d6ae49a8b
+2
View File
@@ -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;