diff --git a/.pick_status.json b/.pick_status.json index abb45ef79b1..7a9f3a7ca96 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4999,7 +4999,7 @@ "description": "vulkan/wsi: check if image info was already freed", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "5b13d74583513ddd029e30c989838b96993545a0" }, diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index 5532c44d7b0..b2974fad7ce 100644 --- a/src/vulkan/wsi/wsi_common.c +++ b/src/vulkan/wsi/wsi_common.c @@ -578,10 +578,22 @@ void wsi_destroy_image_info(const struct wsi_swapchain *chain, struct wsi_image_info *info) { - vk_free(&chain->alloc, (void *)info->create.pQueueFamilyIndices); - vk_free(&chain->alloc, (void *)info->format_list.pViewFormats); - vk_free(&chain->alloc, (void *)info->drm_mod_list.pDrmFormatModifiers); - vk_free(&chain->alloc, info->modifier_props); + if (info->create.pQueueFamilyIndices != NULL) { + vk_free(&chain->alloc, (void *)info->create.pQueueFamilyIndices); + info->create.pQueueFamilyIndices = NULL; + } + if (info->format_list.pViewFormats != NULL) { + vk_free(&chain->alloc, (void *)info->format_list.pViewFormats); + info->format_list.pViewFormats = NULL; + } + if (info->drm_mod_list.pDrmFormatModifiers != NULL) { + vk_free(&chain->alloc, (void *)info->drm_mod_list.pDrmFormatModifiers); + info->drm_mod_list.pDrmFormatModifiers = NULL; + } + if (info->modifier_props != NULL) { + vk_free(&chain->alloc, info->modifier_props); + info->modifier_props = NULL; + } } VkResult