mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
vulkan/wsi/x11: don't crash on null visual
When application window closed unexpectedly due to lost window visualtypes getting invlaid parameters which is causing a crash. Necessary check is added to prevent the crash. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "13.0" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
parent
7a4ea95f1c
commit
01dd363e67
1 changed files with 3 additions and 0 deletions
|
|
@ -349,6 +349,9 @@ x11_surface_get_capabilities(VkIcdSurfaceBase *icd_surface,
|
|||
xcb_visualtype_t *visual =
|
||||
get_visualtype_for_window(conn, window, &visual_depth);
|
||||
|
||||
if (!visual)
|
||||
return VK_ERROR_SURFACE_LOST_KHR;
|
||||
|
||||
geom = xcb_get_geometry_reply(conn, geom_cookie, &err);
|
||||
if (geom) {
|
||||
VkExtent2D extent = { geom->width, geom->height };
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue