From da5a555e401b9d875353ef2ea64d59a474f1f7c5 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Wed, 26 Nov 2025 14:03:18 -0800 Subject: [PATCH] tu: Fix buffer overflow optimizing MSRTT. i is a subpass number, j is the attachment number we're trying to turn into an attachment. Fixes: f6c7f16322de ("tu: Implement VK_EXT_multisampled_render_to_single_sampled") Part-of: --- src/freedreno/vulkan/tu_pass.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedreno/vulkan/tu_pass.cc b/src/freedreno/vulkan/tu_pass.cc index 3e1a13c3021..2e7d455e7d2 100644 --- a/src/freedreno/vulkan/tu_pass.cc +++ b/src/freedreno/vulkan/tu_pass.cc @@ -649,7 +649,7 @@ tu_render_pass_opt_resolve_unresolve(struct tu_render_pass *pass) */ (j == subpass->color_count ? subpass->depth_stencil_attachment.attachment : - subpass->color_attachments[i].attachment) >= + subpass->color_attachments[j].attachment) >= pass->user_attachment_count && /* Check that it's the last use and the original attachment is * not stored.