radeonsi: fix a crash when unbinding sampler states
authorMarek Olšák <marek.olsak@amd.com>
Mon, 8 Apr 2019 18:24:48 +0000 (14:24 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 8 Apr 2019 19:23:32 +0000 (15:23 -0400)
Acked-by: James Zhu <James.Zhu@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c

index 244ba5a7becb767b441973c222242a572c89c359..ac40ed27f91936e31626321cf3bdcedabfb042ed 100644 (file)
@@ -949,7 +949,7 @@ static void si_bind_sampler_states(struct pipe_context *ctx,
        struct si_sampler_state **sstates = (struct si_sampler_state**)states;
        int i;
 
-       if (!count || shader >= SI_NUM_SHADERS)
+       if (!count || shader >= SI_NUM_SHADERS || !sstates)
                return;
 
        for (i = 0; i < count; i++) {