From 57e92ed7682204976214365ca41d5b556f2c56cf Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Tue, 17 Nov 2015 14:11:35 -0600 Subject: [PATCH] compositor: ignore useless surface_damage If we pass negative height or width on to pixman we get error messages in the log. Also, if width or height is 0, there's no damage, so we can early return for that too. Signed-off-by: Derek Foreman Reviewed-by: Pekka Paalanen --- src/compositor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compositor.c b/src/compositor.c index 5fa30cbe..65abb722 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -2579,6 +2579,9 @@ surface_damage(struct wl_client *client, { struct weston_surface *surface = wl_resource_get_user_data(resource); + if (width <= 0 || height <= 0) + return; + pixman_region32_union_rect(&surface->pending.damage, &surface->pending.damage, x, y, width, height);