radeonsi: fix a future crash in emit_cb_target_mask
authorMarek Olšák <marek.olsak@amd.com>
Fri, 6 Nov 2015 22:42:49 +0000 (23:42 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 13 Nov 2015 18:54:41 +0000 (19:54 +0100)
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 <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index 18b64056bc7cbf0d597fde57a1ffeae40f48aee0..eba9c61ff26a4686456985035a9142fd4b69e52f 100644 (file)
@@ -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;