From 72b8e643b0232dfcdcbc9f071c410653bc10d079 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Fri, 12 Feb 2021 08:36:58 +0100 Subject: [PATCH] anv: Allow null handle in DestroyDescriptorUpdateTemplate. By the Vulkan specification, and similarly to many other Vulkan calls, it is allowed to destroy a null descriptor update template. Signed-off-by: Giovanni Mascellani Fixes: af5f13e58c9dfe ("anv: add VK_KHR_descriptor_update_template support") Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_descriptor_set.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index e3895a77234..a8d91b36ed0 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -1805,6 +1805,9 @@ void anv_DestroyDescriptorUpdateTemplate( ANV_FROM_HANDLE(anv_descriptor_update_template, template, descriptorUpdateTemplate); + if (!template) + return; + vk_object_base_finish(&template->base); vk_free2(&device->vk.alloc, pAllocator, template); }