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

noreply at xfce.org noreply at xfce.org
Sun Nov 26 23:29:36 CET 2017


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       m   a   s   t   e   r   
   in repository xfce/xfce4-settings.

commit d0f83ac17ac21ae840f31b4619224610742895f3
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 bf39f59..a035450 100644
--- a/xfsettingsd/displays.c
+++ b/xfsettingsd/displays.c
@@ -862,7 +862,7 @@ xfce_displays_helper_list_outputs (XfceDisplaysHelper *helper)
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
                 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