From 50ae277d90c1eea6bb0086c31e004042088f794f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 22 Sep 2022 18:33:24 +0200 Subject: [PATCH] =?UTF-8?q?wayland:=20don=E2=80=99t=20crash=20with=20a=20d?= =?UTF-8?q?ivision-by-zero=20when=20monitor=20dimensions=20are=20negative?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some compositors set the physical dimensions to -1... --- wayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wayland.c b/wayland.c index 05de79aa..cd052532 100644 --- a/wayland.c +++ b/wayland.c @@ -367,7 +367,7 @@ update_terms_on_monitor(struct monitor *mon) static void output_update_ppi(struct monitor *mon) { - if (mon->dim.mm.width == 0 || mon->dim.mm.height == 0) + if (mon->dim.mm.width <= 0 || mon->dim.mm.height <= 0) return; int x_inches = mon->dim.mm.width * 0.03937008;