<div dir="ltr">OK agree, spec is clear on this matter.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 22, 2016 at 1:48 PM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Nak.<br><br>From the Vulkan spec 1.0.37, valid usage for vkGetSwapchainimagesKHR:<br><ul class="m_5184903635402534703gmail-itemizedlist"><li class="m_5184903635402534703gmail-listitem">
<em class="m_5184903635402534703gmail-parameter"><code>swapchain</code></em> <span class="m_5184903635402534703gmail-normative">must</span> be a valid <code class="m_5184903635402534703gmail-code">VkSwapchainKHR</code> handle
</li></ul>We don't silently handle invalid usage.<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">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(swapchai<wbr>n, pSwapchainImageCount,<br>
                                 pSwapchainImages);<br>
 }<br>
</div></div><span class="HOEnZb"><font color="#888888"><span class="m_5184903635402534703HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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></font></span></blockquote></div><br></div>
</blockquote></div><br></div>