Skip to content

vulkan/device_select: avoid segfault on Wayland if wl_drm is unavailable

Erik Kurzinger requested to merge (removed):device-select-fix into master

On Wayland, if the wl_drm interface is not available, for example if the compositor is using the proprietary NVIDIA driver along with their egl-wayland library, the device_select layer will fail to initialize. However, the failure path will unconditionally call wl_drm_destroy even though info.wl_drm would be NULL in that case. This can cause a segfault in libwayland-client.so.

To fix this, check if info.wl_drm is NULL before calling wl_drm_destroy. This way, initialization will fail gracefully even if that interface is not present.

Merge request reports