mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 20:18:12 +02:00
vulkan/wsi: check if image info was already freed
We set the different data being freed to NULL after freeing it, and checks for NULL before freeing it. This fixes several double free crash with v3dv, when running OOM wsi tests, like for example: dEQP-VK.wsi.xlib.swapchain.simulate_oom.composite_alpha Although note that only one person got those on a new fresh install of the Raspbian OS, so this problem was rare. Fixes:5b13d74583("vulkan/wsi/drm: Break create_native_image in pieces") Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20695> (cherry picked from commitb27e42dcb5)
This commit is contained in:
parent
893910b353
commit
116b1de2aa
2 changed files with 17 additions and 5 deletions
|
|
@ -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"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue