diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2019-02-28 15:14:18 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2019-02-28 15:14:18 +0100 |
commit | 4338fbe801992804b4bf84e14500ead09d810182 (patch) | |
tree | b11a7ad0a9e365a6d3714f6cceb834587718922b /dev-qt | |
parent | x11-misc/obconf-qt: add 0.14.1 for testing (diff) | |
download | qt-4338fbe801992804b4bf84e14500ead09d810182.tar.gz qt-4338fbe801992804b4bf84e14500ead09d810182.tar.bz2 qt-4338fbe801992804b4bf84e14500ead09d810182.zip |
dev-qt/qtquickcontrols: Fix div by zero
KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=403978#c21
Qt-Bug: https://bugreports.qt.io/browse/QTBUG-73691
See also: https://codereview.qt-project.org/#/c/254226/
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11
Diffstat (limited to 'dev-qt')
-rw-r--r-- | dev-qt/qtquickcontrols/files/qtquickcontrols-5.12.1-scrollviewstyle-div-by-zero.patch | 34 | ||||
-rw-r--r-- | dev-qt/qtquickcontrols/qtquickcontrols-5.12.1-r1.ebuild | 34 |
2 files changed, 68 insertions, 0 deletions
diff --git a/dev-qt/qtquickcontrols/files/qtquickcontrols-5.12.1-scrollviewstyle-div-by-zero.patch b/dev-qt/qtquickcontrols/files/qtquickcontrols-5.12.1-scrollviewstyle-div-by-zero.patch new file mode 100644 index 00000000..b58f26ac --- /dev/null +++ b/dev-qt/qtquickcontrols/files/qtquickcontrols-5.12.1-scrollviewstyle-div-by-zero.patch @@ -0,0 +1,34 @@ +From c231395eec3494619f4977b4c5cd845b9d7341ae Mon Sep 17 00:00:00 2001 +From: Benjamin Robin <dev@benjarobin.fr> +Date: Sun, 24 Feb 2019 10:28:14 +0100 +Subject: [PATCH] ScrollViewStyle: Avoid division by zero in extent computation + +If the flickableItem content is empty (contentWidth / contentHeight is +equal to 0), prevent the division by zero in the computation of the +extent variable. + +Task-number: QTBUG-73691 +Change-Id: I86becca9a1fa2508d1acafe09f46dfc952e4e96d +Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> +--- + src/controls/Styles/Base/ScrollViewStyle.qml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/controls/Styles/Base/ScrollViewStyle.qml b/src/controls/Styles/Base/ScrollViewStyle.qml +index 6750399d4..36b518d39 100644 +--- a/src/controls/Styles/Base/ScrollViewStyle.qml ++++ b/src/controls/Styles/Base/ScrollViewStyle.qml +@@ -370,8 +370,8 @@ Style { + + property var flickableItem: control.flickableItem + property int extent: Math.max(minimumHandleLength, __styleData.horizontal ? +- Math.min(1, (flickableItem ? flickableItem.width/flickableItem.contentWidth : 1)) * bg.width : +- Math.min(1, (flickableItem ? flickableItem.height/flickableItem.contentHeight : 1)) * bg.height) ++ Math.min(1, ((flickableItem && flickableItem.contentWidth > 0.0) ? flickableItem.width/flickableItem.contentWidth : 1)) * bg.width : ++ Math.min(1, ((flickableItem && flickableItem.contentHeight > 0.0) ? flickableItem.height/flickableItem.contentHeight : 1)) * bg.height) + readonly property real range: __control.maximumValue - __control.minimumValue + readonly property real begin: __control.value - __control.minimumValue + +-- +2.16.3 + diff --git a/dev-qt/qtquickcontrols/qtquickcontrols-5.12.1-r1.ebuild b/dev-qt/qtquickcontrols/qtquickcontrols-5.12.1-r1.ebuild new file mode 100644 index 00000000..a2971f97 --- /dev/null +++ b/dev-qt/qtquickcontrols/qtquickcontrols-5.12.1-r1.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit qt5-build + +DESCRIPTION="Set of Qt Quick controls to create complete user interfaces (deprecated)" + +if [[ ${QT5_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86" +fi + +IUSE="+widgets" + +DEPEND=" + ~dev-qt/qtcore-${PV} + ~dev-qt/qtdeclarative-${PV} + ~dev-qt/qtgui-${PV} + widgets? ( ~dev-qt/qtwidgets-${PV} ) +" +RDEPEND="${DEPEND}" + +PATCHES=( "${FILESDIR}/${P}-scrollviewstyle-div-by-zero.patch" ) + +src_prepare() { + qt_use_disable_mod widgets widgets \ + src/src.pro \ + src/controls/Private/private.pri \ + tests/auto/activeFocusOnTab/activeFocusOnTab.pro \ + tests/auto/controls/controls.pro \ + tests/auto/testplugin/testplugin.pro + + qt5-build_src_prepare +} |