[Mesa-dev] [PATCH 01/18] anv/pass: Avoid accessing attachment array out of bounds
Jason Ekstrand
jason at jlekstrand.net
Tue Feb 28 04:18:16 UTC 2017
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
On Feb 27, 2017 5:20 PM, "Nanley Chery" <nanleychery at gmail.com> wrote:
> Cc: <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> ---
> src/intel/vulkan/anv_pass.c | 22 +++++++++++++---------
> 1 file changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_pass.c b/src/intel/vulkan/anv_pass.c
> index 2df18260d3..a8b24703bc 100644
> --- a/src/intel/vulkan/anv_pass.c
> +++ b/src/intel/vulkan/anv_pass.c
> @@ -116,13 +116,15 @@ VkResult anv_CreateRenderPass(
> for (uint32_t j = 0; j < desc->inputAttachmentCount; j++) {
> uint32_t a = desc->pInputAttachments[j].attachment;
> subpass->input_attachments[j] = a;
> - pass->attachments[a].usage |= VK_IMAGE_USAGE_INPUT_
> ATTACHMENT_BIT;
> - pass->attachments[a].subpass_usage[i] |=
> ANV_SUBPASS_USAGE_INPUT;
> - pass->attachments[a].last_subpass_idx = i;
> + if (a != VK_ATTACHMENT_UNUSED) {
> + pass->attachments[a].usage |= VK_IMAGE_USAGE_INPUT_
> ATTACHMENT_BIT;
> + pass->attachments[a].subpass_usage[i] |=
> ANV_SUBPASS_USAGE_INPUT;
> + pass->attachments[a].last_subpass_idx = i;
>
> - if (desc->pDepthStencilAttachment &&
> - a == desc->pDepthStencilAttachment->attachment)
> - subpass->has_ds_self_dep = true;
> + if (desc->pDepthStencilAttachment &&
> + a == desc->pDepthStencilAttachment->attachment)
> + subpass->has_ds_self_dep = true;
> + }
> }
> }
>
> @@ -133,9 +135,11 @@ VkResult anv_CreateRenderPass(
> for (uint32_t j = 0; j < desc->colorAttachmentCount; j++) {
> uint32_t a = desc->pColorAttachments[j].attachment;
> subpass->color_attachments[j] = a;
> - pass->attachments[a].usage |= VK_IMAGE_USAGE_COLOR_
> ATTACHMENT_BIT;
> - pass->attachments[a].subpass_usage[i] |=
> ANV_SUBPASS_USAGE_DRAW;
> - pass->attachments[a].last_subpass_idx = i;
> + if (a != VK_ATTACHMENT_UNUSED) {
> + pass->attachments[a].usage |= VK_IMAGE_USAGE_COLOR_
> ATTACHMENT_BIT;
> + pass->attachments[a].subpass_usage[i] |=
> ANV_SUBPASS_USAGE_DRAW;
> + pass->attachments[a].last_subpass_idx = i;
> + }
> }
> }
>
> --
> 2.11.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170227/cf166bda/attachment-0001.html>
More information about the mesa-dev
mailing list