[PATCH] compositor: Check buffer is valid after retrieving it from the resource

Rob Bradford rob at robster.org.uk
Tue May 22 03:11:10 PDT 2012


*cough* *cough*

The astute of you would have notice this patch is wrong since
weston_surface_attach called with a NULL buffer is an expected and
desired behaviour :-)

Cheers,

Rob

On 21 May 2012 19:26, Rob Bradford <rob at robster.org.uk> wrote:
> From: Rob Bradford <rob at linux.intel.com>
>
> ---
>  src/compositor.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/compositor.c b/src/compositor.c
> index ba201af..83305f3 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -2006,12 +2006,12 @@ pointer_attach(struct wl_client *client, struct wl_resource *resource,
>        if (buffer_resource)
>                buffer = buffer_resource->data;
>
> -       weston_surface_attach(&seat->sprite->surface, buffer);
> -       empty_region(&seat->sprite->input);
> -
>        if (!buffer)
>                return;
>
> +       weston_surface_attach(&seat->sprite->surface, buffer);
> +       empty_region(&seat->sprite->input);
> +
>        if (!weston_surface_is_mapped(seat->sprite)) {
>                wl_list_insert(&compositor->cursor_layer.surface_list,
>                               &seat->sprite->layer_link);
> --
> 1.7.7.6
>


More information about the wayland-devel mailing list