x11: protect against division by 0 in init_xrandr13()

From: Pavel Roskin <plroskin@gmail.com>


---
 gdk/x11/gdkscreen-x11.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 5011155..9ac6871 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -581,7 +581,8 @@ init_randr13 (GdkScreen *screen, gboolean *changed)
               XRRModeInfo *xmode = &resources->modes[j];
               if (xmode->id == crtc->mode)
                 {
-                  refresh_rate = (1000 * xmode->dotClock) / (xmode->hTotal *xmode->vTotal);
+                  if (xmode->hTotal != 0 && xmode->vTotal != 0)
+                    refresh_rate = (1000 * xmode->dotClock) / (xmode->hTotal * xmode->vTotal);
                   break;
                 }
             }
