[Xfce4-commits] [xfce/xfce4-settings] 02/02: Fix division by 0 crash

noreply at xfce.org noreply at xfce.org
Tue Feb 27 23:25:14 CET 2018


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       x   f   c   e   -   4   .   1   2   
   in repository xfce/xfce4-settings.

commit 48443315140f00c16d4c36d9f3d0a2a5d3360c14
Author: Florian Schüller <florian.schueller at gmail.com>
Date:   Sun Nov 26 10:48:35 2017 +0100

    Fix division by 0 crash
    
    While it isn't clear why gdk_screen_height_mm() would be 0 in the first place
    some users faced this so we try to be on the safe side.
---
 xfsettingsd/displays.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xfsettingsd/displays.c b/xfsettingsd/displays.c
index de91c14..c235992 100644
--- a/xfsettingsd/displays.c
+++ b/xfsettingsd/displays.c
@@ -861,7 +861,7 @@ xfce_displays_helper_list_outputs (XfceDisplaysHelper *helper)
 
                 if (l < output->info->npreferred)
                     dist = 0;
-                else if (output->info->mm_height != 0)
+                else if ((output->info->mm_height != 0) && (gdk_screen_height_mm () != 0))
                     dist = (1000 * gdk_screen_height () / gdk_screen_height_mm () -
                             1000 * helper->resources->modes[m].height / output->info->mm_height);
                 else

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list