[PATCH weston 08/11] compositor: ignore surface_damage with negative height or width

Derek Foreman derekf at osg.samsung.com
Wed Nov 18 14:32:31 PST 2015


If we pass negative height or width on to pixman we get error messages
in the log.

Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
 src/compositor.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compositor.c b/src/compositor.c
index 666bc15..0efb325 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2574,6 +2574,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);
-- 
2.6.2



More information about the wayland-devel mailing list