<div dir="ltr"><div>Seems reasonable<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 6, 2017 at 8:56 PM, Ben Widawsky <span dir="ltr"><<a href="mailto:ben@bwidawsk.net" target="_blank">ben@bwidawsk.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The API/entry point in mesa already checks the correct behavior,<br>
however, it's possible to be handled by another implementation and those<br>
implementations should not be able to abuse a weird combination of count<br>
and pointer.<br>
<br>
This fixes CID 1403193<br>
<br>
Cc: Mark Janes <<a href="mailto:mark.a.janes@intel.com">mark.a.janes@intel.com</a>><br>
Signed-off-by: Ben Widawsky <<a href="mailto:ben@bwidawsk.net">ben@bwidawsk.net</a>><br>
---<br>
src/gbm/backends/dri/gbm_dri.c | 3 +++<br>
1 file changed, 3 insertions(+)<br>
<br>
diff --git a/src/gbm/backends/dri/gbm_<wbr>dri.c b/src/gbm/backends/dri/gbm_<wbr>dri.c<br>
index 8df6a6b64d..71590d7110 100644<br>
--- a/src/gbm/backends/dri/gbm_<wbr>dri.c<br>
+++ b/src/gbm/backends/dri/gbm_<wbr>dri.c<br>
@@ -1266,6 +1266,9 @@ gbm_dri_surface_create(struct gbm_device *gbm,<br>
return NULL;<br>
}<br>
<br>
+ if (count)<br>
+ assert(modifiers);<br>
+<br>
/* It's acceptable to create an image with INVALID modifier in the list,<br>
* but it cannot be on the only modifier (since it will certainly fail<br>
* later). While we could easily catch this after modifier creation, doing<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.12.2<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></div>