This is similar to
f44baf51d9e8616a but for RandR 1.3 servers like
x11rdp and Windows Exceed which don't return a refresh rate. Avoid a
crash when that happens.
https://bugzilla.gnome.org/show_bug.cgi?id=775546
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;
}
}