From c9ff826fbef2b9d4df84c1ef5ec5eba33661abee Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 14 Apr 2014 10:04:14 +0200 Subject: [PATCH] xwindow_shape_pixmap: Correctly handle invalid geometry Signed-off-by: Uli Schlachter --- xwindow.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xwindow.c b/xwindow.c index 2c38dcef..ab31b526 100644 --- a/xwindow.c +++ b/xwindow.c @@ -329,6 +329,9 @@ xwindow_shape_pixmap(int width, int height, cairo_surface_t *surf) cairo_surface_t *dest; cairo_t *cr; + if (width <= 0 || height <= 0) + return XCB_NONE; + xcb_create_pixmap(globalconf.connection, 1, pixmap, globalconf.screen->root, width, height); dest = cairo_xcb_surface_create_for_bitmap(globalconf.connection, globalconf.screen, pixmap, width, height);