summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_x11.c
diff options
context:
space:
mode:
authorDaniel Czarnowski <daniel.czarnowski@intel.com>2016-02-11 14:03:58 +0200
committerTapani Pälli <tapani.palli@intel.com>2016-02-15 07:43:27 +0200
commit5d87a7c894d8327491be804fee8005fadfaeb3f1 (patch)
tree70c759dd44bd32c487837a7f57ac8c2359409e9d /src/egl/drivers/dri2/platform_x11.c
parent331f963b7e34e292300fb17f86310c76be07d644 (diff)
downloadexternal_mesa3d-5d87a7c894d8327491be804fee8005fadfaeb3f1.zip
external_mesa3d-5d87a7c894d8327491be804fee8005fadfaeb3f1.tar.gz
external_mesa3d-5d87a7c894d8327491be804fee8005fadfaeb3f1.tar.bz2
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@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org
Diffstat (limited to 'src/egl/drivers/dri2/platform_x11.c')
-rw-r--r--src/egl/drivers/dri2/platform_x11.c2
1 files changed, 2 insertions, 0 deletions
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;