<div dir="ltr">Oops, sorry about that.<div><br></div><div>Reviewed-by: Alex Smith <<a href="mailto:asmith@feralinteractive.com">asmith@feralinteractive.com</a>></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 18 January 2018 at 01:16, 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">Without this, we may end up dereferencing blend before we check for<br>
binding->index != UINT32_MAX. However, Vulkan allows the blend state to<br>
be NULL so long as you don't have any color attachments. This fixes a<br>
segfault when running The Talos Principal.<br>
<br>
Fixes: 12f4e00b69e724a23504b7bd3958fb<wbr>75dc462950<br>
Cc: <a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.<wbr>org</a><br>
---<br>
src/intel/vulkan/genX_<wbr>pipeline.c | 6 +++---<br>
1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/genX_<wbr>pipeline.c b/src/intel/vulkan/genX_<wbr>pipeline.c<br>
index cfc3bea..e8ac7c6 100644<br>
--- a/src/intel/vulkan/genX_<wbr>pipeline.c<br>
+++ b/src/intel/vulkan/genX_<wbr>pipeline.c<br>
@@ -1345,10 +1345,10 @@ has_color_buffer_write_<wbr>enabled(const struct anv_pipeline *pipeline,<br>
if (binding->set != ANV_DESCRIPTOR_SET_COLOR_<wbr>ATTACHMENTS)<br>
continue;<br>
<br>
- const VkPipelineColorBlendAttachment<wbr>State *a =<br>
- &blend->pAttachments[binding-><wbr>index];<br>
+ if (binding->index == UINT32_MAX)<br>
+ continue;<br>
<br>
- if (binding->index != UINT32_MAX && a->colorWriteMask != 0)<br>
+ if (blend->pAttachments[binding-><wbr>index].colorWriteMask != 0)<br>
return true;<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.5.0.400.gff86faf<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>