From 457a385fa753886836151d3a5ca8452937746ffc Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 13 Mar 2014 12:50:18 -0400 Subject: [PATCH] clamp screen sizes to 1 to avoid impossible division-by-zero for window shots CID 1040148 --- src/modules/shot/e_mod_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/shot/e_mod_main.c b/src/modules/shot/e_mod_main.c index d6a3b6a67..9a6abd398 100644 --- a/src/modules/shot/e_mod_main.c +++ b/src/modules/shot/e_mod_main.c @@ -647,8 +647,8 @@ _shot_now(E_Zone *zone, E_Client *ec, const char *params) h = sh; x = E_CLAMP(x, ec->zone->x, ec->zone->x + ec->zone->w); y = E_CLAMP(y, ec->zone->y, ec->zone->y + ec->zone->h); - sw = E_CLAMP(sw, 0, ec->zone->x + ec->zone->w - x); - sh = E_CLAMP(sh, 0, ec->zone->y + ec->zone->h - y); + sw = E_CLAMP(sw, 1, ec->zone->x + ec->zone->w - x); + sh = E_CLAMP(sh, 1, ec->zone->y + ec->zone->h - y); visual = e_pixmap_visual_get(ec->pixmap); depth = ec->depth; }