From: Marek Olšák Date: Fri, 6 Nov 2015 22:42:49 +0000 (+0100) Subject: radeonsi: fix a future crash in emit_cb_target_mask X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e15c5c7a069a8dd8e0ad97f0f405a85f0f52d9f4;p=mesa.git radeonsi: fix a future crash in emit_cb_target_mask This can't crash currently, but it would crash if clear_buffer from u_blitter were used with a clean context. Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 18b64056bc7..eba9c61ff26 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -265,7 +265,7 @@ static void si_emit_cb_target_mask(struct si_context *sctx, struct r600_atom *at * * Reproducible with Unigine Heaven 4.0 and drirc missing. */ - if (blend->dual_src_blend && + if (blend && blend->dual_src_blend && sctx->ps_shader.cso && (sctx->ps_shader.cso->ps_colors_written & 0x3) != 0x3) mask = 0;