diff --git a/SOURCES/0001-x11-Avoid-a-division-by-zero.patch b/SOURCES/0001-x11-Avoid-a-division-by-zero.patch new file mode 100644 index 0000000..832de44 --- /dev/null +++ b/SOURCES/0001-x11-Avoid-a-division-by-zero.patch @@ -0,0 +1,31 @@ +From cc967849f7653c697c33571a1a6a55e9ffd966ff Mon Sep 17 00:00:00 2001 +From: Pavel Roskin +Date: Thu, 8 Mar 2018 15:58:42 +0100 +Subject: [PATCH] x11: Avoid a division by zero + +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 +--- + 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 20fd27531e45..272cecd7aa4b 100644 +--- a/gdk/x11/gdkscreen-x11.c ++++ b/gdk/x11/gdkscreen-x11.c +@@ -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; + } + } +-- +2.14.3 + diff --git a/SPECS/gtk3.spec b/SPECS/gtk3.spec index e3726cc..1136781 100644 --- a/SPECS/gtk3.spec +++ b/SPECS/gtk3.spec @@ -22,7 +22,7 @@ Name: gtk3 Version: 3.22.26 -Release: 3%{?dist} +Release: 4%{?dist} Summary: GTK+ graphical user interface library License: LGPLv2+ @@ -39,6 +39,9 @@ Patch19: 0001-gdk-Always-emit-motion-after-enter.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1483942 Patch20: x11-Dont-call-XInput-API-for-core-events.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1502788 +Patch21: 0001-x11-Avoid-a-division-by-zero.patch + BuildRequires: pkgconfig(atk) >= %{atk_version} BuildRequires: pkgconfig(atk-bridge-2.0) BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} @@ -177,6 +180,7 @@ the functionality of the installed %{name} package. %patch18 -p1 %patch19 -p1 %patch20 -p1 +%patch21 -p1 cp %{SOURCE1} po/ @@ -368,6 +372,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/installed-tests %changelog +* Mon Apr 09 2018 Debarshi Ray - 3.22.26-4 +- Avoid a division by zero with RandR 1.3 +- Resolves: #1502788 + * Tue Feb 13 2018 Ray Strode - 3.22.26-3 - Fix emacs on Xming Resolves: #1483942