zink: don't crash when setting rast-state to NULL
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 15 Jul 2019 12:44:11 +0000 (14:44 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:46 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_state.c

index 814e1e29b6c5dae43c1ab060cad3a451861793c4..709627079d81199ab53a7945f703a2da5d99c11e 100644 (file)
@@ -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