egl_dri2: NULL check for xcb_dri2_get_buffers_reply()
authorDaniel Czarnowski <daniel.czarnowski@intel.com>
Thu, 11 Feb 2016 12:03:58 +0000 (14:03 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 15 Feb 2016 05:43:27 +0000 (07:43 +0200)
Without the check, unsuccessful xcb_dri2_get_buffers_reply(...) causes
segmentation fault in dri2_get_buffers.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org
src/egl/drivers/dri2/platform_x11.c

index 08cbf2d8393f80d7acd45a9ab0ec056071cf3b9d..931ee511f155c8cf999d9edbac515e5a00b63c0a 100644 (file)
@@ -472,6 +472,8 @@ dri2_x11_get_buffers(__DRIdrawable * driDrawable,
                                            dri2_surf->drawable,
                                            count, count, attachments);
    reply = xcb_dri2_get_buffers_reply (dri2_dpy->conn, cookie, NULL);
+   if (reply == NULL)
+      return NULL;
    buffers = xcb_dri2_get_buffers_buffers (reply);
    if (buffers == NULL)
       return NULL;