There's nothing to stop a client from sending these requests to screens
without DRI3 support, and if they do, we'll crash. Let's not do that.
Reviewed-by: Jasper St. Pierre <<jstpierre@mecheye.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
dri3_screen_info_ptr info = ds->info;
PixmapPtr pixmap;
+ if (!info || !info->pixmap_from_fd)
+ return BadImplementation;
+
pixmap = (*info->pixmap_from_fd) (screen, fd, width, height, stride, depth, bpp);
if (!pixmap)
return BadAlloc;
dri3_screen_info_ptr info = ds->info;
int fd;
+ if (!info || !info->fd_from_pixmap)
+ return BadImplementation;
+
fd = (*info->fd_from_pixmap)(screen, pixmap, stride, size);
if (fd < 0)
return BadAlloc;