[Mesa-stable] [Mesa-dev] [PATCH] egl/x11: check the return value of xcb_dri2_get_buffers_reply()

Eduardo Lima Mitev elima at igalia.com
Sun Mar 6 08:05:08 UTC 2016


On 03/05/2016 10:25 PM, Emil Velikov wrote:
> ... 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 at suse.com>
> Cc: "11.1 11.2" <mesa-stable at lists.freedesktop.org>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93667
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>   src/egl/drivers/dri2/platform_x11.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
> index 420f567..3ab9188 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;
> +

Yes, this is the completing part of commit 
5d87a7c894d8327491be804fee8005fadfaeb3f1.

Reviewed-by: Eduardo Lima Mitev <elima at igalia.com>

>      buffers = xcb_dri2_get_buffers_buffers (buffers_reply);
>      if (buffers == NULL) {
>         return NULL;
>



More information about the mesa-stable mailing list