forked from AuroraMiddleware/gtk
x11: Avoid a division by zero
This is similar to f44baf51d9
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
This commit is contained in:
parent
add3592809
commit
cc967849f7
@ -658,7 +658,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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user