commit: 54d151352e8c117dfb251b174ae35699e7ad4236 Author: Davide Pesavento <pesa <AT> gentoo <DOT> org> AuthorDate: Wed Jun 18 14:13:35 2014 +0000 Commit: Davide Pesavento <pesa <AT> gentoo <DOT> org> CommitDate: Wed Jun 18 14:13:35 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=54d15135
[dev-qt/qtgui:4] Backport patch to fix FPE crash in cleanlooks style. Thanks to Alexandre Rostovtsev in bug #507124. Package-Manager: portage-2.2.10 --- ...4.8.6-cleanlooks-floating-point-exception.patch | 38 ++++++++++++++++++++++ dev-qt/qtgui/qtgui-4.8.6.ebuild | 1 + 2 files changed, 39 insertions(+) diff --git a/dev-qt/qtgui/files/qtgui-4.8.6-cleanlooks-floating-point-exception.patch b/dev-qt/qtgui/files/qtgui-4.8.6-cleanlooks-floating-point-exception.patch new file mode 100644 index 0000000..a54efef --- /dev/null +++ b/dev-qt/qtgui/files/qtgui-4.8.6-cleanlooks-floating-point-exception.patch @@ -0,0 +1,38 @@ +From 0db65e148dcb4d5e5b98475f207d41a287c401a1 Mon Sep 17 00:00:00 2001 +From: Alexandre Rostovtsev <[email protected]> +Date: Wed, 28 May 2014 00:22:55 -0400 +Subject: [PATCH] Cleanlooks style: Fix floating point exception + +In QCleanlooksStyle::drawControl, if indeterminate == true and +rect.width() == 4, we will end up with slideWidth of zero, and +take a mod by zero when calculating the value of step. + +This causes a crash in Quassel 0.10; see +https://bugs.gentoo.org/show_bug.cgi?id=507124 + +Instead, calculate slideWidth based on max(width, minWidth) where +minWidth was already set as 4, ensuring that slideWidth >= 2. + +Change-Id: I6678789105e359fa26c99409f449cad0ba3bd0ae +(cherry picked from qtstyleplugins/8ff2ac6035fb1d01f5c0054ba14afb949410e3a7) +Reviewed-by: Giuseppe D'Angelo <[email protected]> +--- + src/gui/styles/qcleanlooksstyle.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp +index 504734a..3f665ca 100644 +--- a/src/gui/styles/qcleanlooksstyle.cpp ++++ b/src/gui/styles/qcleanlooksstyle.cpp +@@ -1773,7 +1773,7 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o + } + } else { + Q_D(const QCleanlooksStyle); +- int slideWidth = ((rect.width() - 4) * 2) / 3; ++ int slideWidth = (qMax(rect.width() - 4, minWidth) * 2) / 3; + int step = ((d->animateStep * slideWidth) / d->animationFps) % slideWidth; + if ((((d->animateStep * slideWidth) / d->animationFps) % (2 * slideWidth)) >= slideWidth) + step = slideWidth - step; +-- +2.0.0 + diff --git a/dev-qt/qtgui/qtgui-4.8.6.ebuild b/dev-qt/qtgui/qtgui-4.8.6.ebuild index 9adb751..432fe08 100644 --- a/dev-qt/qtgui/qtgui-4.8.6.ebuild +++ b/dev-qt/qtgui/qtgui-4.8.6.ebuild @@ -70,6 +70,7 @@ PDEPEND=" PATCHES=( "${FILESDIR}/${PN}-4.7.3-cups.patch" # bug 323257 "${FILESDIR}/${PN}-4.8.5-dont-crash-on-broken-GIF-images.patch" # bug 508984 + "${FILESDIR}/${PN}-4.8.6-cleanlooks-floating-point-exception.patch" # bug 507124 "${FILESDIR}/${PN}-4.8.6-disable-gtk-theme-check.patch" # bug 491226 )
