<div dir="ltr">Nak.<br><br>From the Vulkan spec 1.0.37, valid usage for vkGetSwapchainimagesKHR:<br><ul class="gmail-itemizedlist"><li class="gmail-listitem">
<em class="gmail-parameter"><code>swapchain</code></em> <span class="gmail-normative">must</span> be a valid <code class="gmail-code">VkSwapchainKHR</code> handle
</li></ul>We don't silently handle invalid usage.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 22, 2016 at 9:30 AM, Arda Coskunses <span dir="ltr"><<a href="mailto:acoskunses@gmail.com" target="_blank">acoskunses@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When application window closed unexpectedly<br>
anv_GetSwapchainImagesKHR function getting<br>
called with invlid parameters which cause a<br>
crash. Necessary Null check added<br>
---<br>
 src/intel/vulkan/anv_wsi.c | 3 +++<br>
 1 file changed, 3 insertions(+)<br>
<br>
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c<br>
index 669eacc..1e05daf 100644<br>
--- a/src/intel/vulkan/anv_wsi.c<br>
+++ b/src/intel/vulkan/anv_wsi.c<br>
@@ -320,6 +320,9 @@ VkResult anv_GetSwapchainImagesKHR(<br>
 {<br>
    ANV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain);<br>
<br>
+   if(!swapchain)<br>
+      return VK_INCOMPLETE;<br>
+<br>
    return swapchain->get_images(<wbr>swapchain, pSwapchainImageCount,<br>
                                 pSwapchainImages);<br>
 }<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>