From 755037e09d753a4bee5daf2532da7b35f1e457c1 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 15 Jul 2019 14:44:11 +0200 Subject: [PATCH] zink: don't crash when setting rast-state to NULL Acked-by: Jordan Justen --- src/gallium/drivers/zink/zink_state.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_state.c b/src/gallium/drivers/zink/zink_state.c index 814e1e29b6c..709627079d8 100644 --- a/src/gallium/drivers/zink/zink_state.c +++ b/src/gallium/drivers/zink/zink_state.c @@ -406,7 +406,9 @@ zink_bind_rasterizer_state(struct pipe_context *pctx, void *cso) { struct zink_context *ctx = zink_context(pctx); ctx->rast_state = cso; - ctx->gfx_pipeline_state.rast_state = &ctx->rast_state->hw_state; + + if (ctx->rast_state) + ctx->gfx_pipeline_state.rast_state = &ctx->rast_state->hw_state; } static void -- 2.30.2