[PATCH] window width or height <= 0 crashes the compositor

twied twied at gmx.net
Sun Jan 16 06:15:38 PST 2011


Hi,

I'm new to Wayland and not quite sure if this is the right place to check  
if the window's dimensions become zero or less. But at least it prevents  
the compositor from crashing.

diff --git a/clients/window.c b/clients/window.c
index 84d0418..4f473c0 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1044,6 +1044,12 @@ handle_configure(void *data, struct wl_shell *shell,
         struct window *window = wl_surface_get_user_data(surface);
         int32_t child_width, child_height;

+       /* FIXME this is probably the wrong place to check for width or
+          height <= 0, but it prevents the compositor from crashing
+       */
+       if(width <= 0 || height <= 0)
+               return;
+
         if (window->resize_handler) {
                 child_width = width - 20 - window->margin * 2;
                 child_height = height - 60 - window->margin * 2;


More information about the wayland-devel mailing list