diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2016-03-05 21:25:44 +0000 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2016-04-11 21:02:18 +0100 |
commit | 6dff29d926e58fc8ecd67ef8a845cf3dcadc3a35 (patch) | |
tree | 688f4d8e255c5bc493817176b22411217e7370e4 | |
parent | 79ba53f574f636ef3f0c3d15350206b5428ae652 (diff) |
egl/x11: check the return value of xcb_dri2_get_buffers_reply()
... before using it. The function can return NULL, which we should check
prior to refererencing it in the next function(s).
Cc: Fabian Vogt <fvogt@suse.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93667
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
(cherry picked from commit b9c5c4af6dbfab28b1f0a78e41bffff1b2e06ce9)
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 420f567651c..3ab91886e01 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -1006,6 +1006,9 @@ dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx, geometry_cookie = xcb_get_geometry (dri2_dpy->conn, drawable); buffers_reply = xcb_dri2_get_buffers_reply (dri2_dpy->conn, buffers_cookie, NULL); + if (buffers_reply == NULL) + return NULL; + buffers = xcb_dri2_get_buffers_buffers (buffers_reply); if (buffers == NULL) { return NULL; |