[Mesa-dev] [PATCH 3/6] radeonsi: fix a future crash in emit_cb_target_mask

Marek Olšák maraeo at gmail.com
Sun Nov 8 13:44:26 PST 2015


From: Marek Olšák <marek.olsak at amd.com>

This can't crash currently, but it would crash if clear_buffer
from u_blitter were used with a clean context.
---
 src/gallium/drivers/radeonsi/si_state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 18b6405..eba9c61 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;
-- 
2.1.4



More information about the mesa-dev mailing list