Mesa (master): egl_dri2: NULL check for xcb_dri2_get_buffers_reply()

Tapani Pälli tpalli at kemper.freedesktop.org
Mon Feb 15 05:45:27 UTC 2016


Module: Mesa
Branch: master
Commit: 5d87a7c894d8327491be804fee8005fadfaeb3f1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5d87a7c894d8327491be804fee8005fadfaeb3f1

Author: Daniel Czarnowski <daniel.czarnowski at intel.com>
Date:   Thu Feb 11 14:03:58 2016 +0200

egl_dri2: NULL check for xcb_dri2_get_buffers_reply()

Without the check, unsuccessful xcb_dri2_get_buffers_reply(...) causes
segmentation fault in dri2_get_buffers.

Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Cc: "11.0 11.1" <mesa-stable at lists.freedesktop.org

---

 src/egl/drivers/dri2/platform_x11.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 08cbf2d..931ee51 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -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;




More information about the mesa-commit mailing list