summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-21 21:15:43 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-21 21:15:43 +0100
commitae21832823f6cc72d5c4d11092456eb86dfe15e4 (patch)
tree00cdeeff270e8891309b6c3598f7829401be845a
parent5e572053656368b0e70a99f8a5129a5e4fa7cb98 (diff)
parentd104d8447b6594f3372b919797c4b0d9300817ba (diff)
Merge pull request #73622 from ChibiDenDen/patch-2
Fix use-after-free for VkAttachmentReference
-rw-r--r--drivers/vulkan/vulkan_context.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp
index b8cea7136d..f185a5cb88 100644
--- a/drivers/vulkan/vulkan_context.cpp
+++ b/drivers/vulkan/vulkan_context.cpp
@@ -101,6 +101,7 @@ VkResult VulkanContext::vkCreateRenderPass2KHR(VkDevice p_device, const VkRender
attachments.push_back(att);
}
+ Vector<Vector<VkAttachmentReference>> attachment_references;
Vector<VkSubpassDescription> subpasses;
for (uint32_t i = 0; i < p_create_info->subpassCount; i++) {
// Here we need to do more, again it's just stripping out type and next
@@ -124,6 +125,10 @@ VkResult VulkanContext::vkCreateRenderPass2KHR(VkDevice p_device, const VkRender
p_create_info->pSubpasses[i].preserveAttachmentCount, /* preserveAttachmentCount */
p_create_info->pSubpasses[i].pPreserveAttachments /* pPreserveAttachments */
};
+ attachment_references.push_back(input_attachments);
+ attachment_references.push_back(color_attachments);
+ attachment_references.push_back(resolve_attachments);
+ attachment_references.push_back(depth_attachments);
subpasses.push_back(subpass);
}