Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5565624 authored by Daniel Koch's avatar Daniel Koch Committed by Jesse Hall
Browse files

libvulkan: add NULL check to DestroySwapchainKHR

vkDestroySwapchainKHR is required to silently ignore NULL handles
that are provided to it to destroy.
This adds an early return if swapchain_handle is NULL.

Test: dEQP-VK.wsi.android.swapchain.destroy.null_handle (VK 1.0.2 CTS)

Change-Id: Ic230f114a680210cb0e0de931b17e4d70fb27f44
(cherry picked from commit d78c2e8a)
parent a9cc65f7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -719,6 +719,8 @@ void DestroySwapchainKHR(VkDevice device,
                         const VkAllocationCallbacks* allocator) {
    const auto& dispatch = GetData(device).driver;
    Swapchain* swapchain = SwapchainFromHandle(swapchain_handle);
    if (!swapchain)
        return;
    bool active = swapchain->surface.swapchain_handle == swapchain_handle;
    ANativeWindow* window = active ? swapchain->surface.window.get() : nullptr;