From cf26e274c728925fac9d3b0d8664651452a783af Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 11 Jul 2022 15:04:00 -0400 Subject: [PATCH] lavapipe: don't crash on null xfb buffer pointer cc: mesa-stable Reviewed-by: Dave Airlie Part-of: (cherry picked from commit fb917a606cf9cc50b40e06730f296a092db82c51) --- .pick_status.json | 2 +- src/gallium/frontends/lavapipe/lvp_execute.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 2a0318efaaf..cba00123a1b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -184,7 +184,7 @@ "description": "lavapipe: don't crash on null xfb buffer pointer", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index ce5e6bdf976..4cb05e3ef69 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -3372,7 +3372,7 @@ static void handle_begin_transform_feedback(struct vk_cmd_queue_entry *cmd, memset(offsets, 0, sizeof(uint32_t)*4); - for (unsigned i = 0; i < btf->counter_buffer_count; i++) { + for (unsigned i = 0; btf->counter_buffers && i < btf->counter_buffer_count; i++) { if (!btf->counter_buffers[i]) continue; @@ -3392,7 +3392,7 @@ static void handle_end_transform_feedback(struct vk_cmd_queue_entry *cmd, struct vk_cmd_end_transform_feedback_ext *etf = &cmd->u.end_transform_feedback_ext; if (etf->counter_buffer_count) { - for (unsigned i = 0; i < etf->counter_buffer_count; i++) { + for (unsigned i = 0; etf->counter_buffers && i < etf->counter_buffer_count; i++) { if (!etf->counter_buffers[i]) continue;