[PATCH] terminal: fix crashing when terminal size is < 0

Tiago Vignatti tiago.vignatti at nokia.com
Fri Nov 12 10:15:45 PST 2010


Just skip drawing when width or height is less than zero.

Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
haven't tested actually whether child windows still okay.

 clients/terminal.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/clients/terminal.c b/clients/terminal.c
index c841ef2..4d8474c 100644
--- a/clients/terminal.c
+++ b/clients/terminal.c
@@ -203,6 +203,10 @@ terminal_draw(struct terminal *terminal)
 		(int32_t) terminal->extents.max_x_advance;
 	height = (rectangle.height - 2 * terminal->margin) /
 		(int32_t) terminal->extents.height;
+
+	if (width < 0 || height < 0)
+		return;
+
 	terminal_resize(terminal, width, height);
 
 	if (!terminal->fullscreen) {
-- 
1.7.0.4



More information about the wayland-devel mailing list