From e385913c21d8c85eab5127a466bedb6b99338519 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 9 Jun 2023 16:19:05 +1000 Subject: [PATCH] lavapipe: check sampler pointer before deref This fixes the vulkan samples deferred demo from crashing in here. Cc: mesa-stable Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/frontends/lavapipe/lvp_execute.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index 0220397..070dea4 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -1271,6 +1271,8 @@ static void fill_sampler_stage(struct rendering_state *state, ss_idx += array_idx; ss_idx += dyn_info->stage[stage].sampler_count; struct pipe_sampler_state *ss = binding->immutable_samplers ? binding->immutable_samplers[array_idx] : descriptor->sampler; + if (!ss) + return; state->ss[p_stage][ss_idx] = *ss; if (state->num_sampler_states[p_stage] <= ss_idx) state->num_sampler_states[p_stage] = ss_idx + 1; -- 2.7.4