<div dir="ltr">Reviewed-by: Jasper St. Pierre <<a href="mailto:jstpierre@mecheye.net">jstpierre@mecheye.net</a>></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 13, 2013 at 12:05 PM, Adam Jackson <span dir="ltr"><<a href="mailto:ajax@redhat.com" target="_blank">ajax@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There's nothing to stop a client from sending these requests to screens<br>
without DRI3 support, and if they do, we'll crash.  Let's not do that.<br>
<br>
Signed-off-by: Adam Jackson <<a href="mailto:ajax@redhat.com">ajax@redhat.com</a>><br>
---<br>
 dri3/dri3_screen.c | 6 ++++++<br>
 1 file changed, 6 insertions(+)<br>
<br>
diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c<br>
index cf2735b..c880296 100644<br>
--- a/dri3/dri3_screen.c<br>
+++ b/dri3/dri3_screen.c<br>
@@ -55,6 +55,9 @@ dri3_pixmap_from_fd(PixmapPtr *ppixmap, ScreenPtr screen, int fd,<br>
     dri3_screen_info_ptr        info = ds->info;<br>
     PixmapPtr                   pixmap;<br>
<br>
+    if (!info || !info->pixmap_from_fd)<br>
+        return BadImplementation;<br>
+<br>
     pixmap = (*info->pixmap_from_fd) (screen, fd, width, height, stride, depth, bpp);<br>
     if (!pixmap)<br>
         return BadAlloc;<br>
@@ -71,6 +74,9 @@ dri3_fd_from_pixmap(int *pfd, PixmapPtr pixmap, CARD16 *stride, CARD32 *size)<br>
     dri3_screen_info_ptr        info = ds->info;<br>
     int                         fd;<br>
<br>
+    if (!info || !info->fd_from_pixmap)<br>
+        return BadImplementation;<br>
+<br>
     fd = (*info->fd_from_pixmap)(screen, pixmap, stride, size);<br>
     if (fd < 0)<br>
         return BadAlloc;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.4.2<br>
<br>
_______________________________________________<br>
<a href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a>: X.Org development<br>
Archives: <a href="http://lists.x.org/archives/xorg-devel" target="_blank">http://lists.x.org/archives/xorg-devel</a><br>
Info: <a href="http://lists.x.org/mailman/listinfo/xorg-devel" target="_blank">http://lists.x.org/mailman/listinfo/xorg-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>  Jasper<br>
</div>