summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFilippo Cucchetto <f.cucchetto@asem.it>2016-11-23 10:08:38 +0100
committerFilippo Cucchetto <filippocucchetto@gmail.com>2016-11-23 10:44:05 +0000
commit32831880512272968e26ed6a85a5cd98ecbda3b6 (patch)
tree4d28ce391f211f6ad67e4594568c6ebc711b1d1e /src
parenteb2df59fb203668734d652808c74b0504864cc1e (diff)
downloadqtquickcontrols-32831880512272968e26ed6a85a5cd98ecbda3b6.tar.gz
Fixed possible crash due to out of memory on ARM
When diving two real values we can obtain an Infinite value. The qml engine perform an implicit conversion (and silent) if this value is directly assigned to an "int" property. On Arm the conversion of Infinite to int gives the value +2147483648. Thus the Repeater model instantiate 2147483648 items and crashes. By morphing both the rowHeight and paddedRowCount properties to "real" we keep the Infinite value semantic. This allows the Repeater to handle properly the Infinite case. Task-number: QTBUG-57283 Change-Id: I376f9ca497bea1f1aab413d1c1ba87d918b73fbb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/controls/Private/BasicTableView.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/controls/Private/BasicTableView.qml b/src/controls/Private/BasicTableView.qml
index afec226d..b919f135 100644
--- a/src/controls/Private/BasicTableView.qml
+++ b/src/controls/Private/BasicTableView.qml
@@ -471,8 +471,8 @@ ScrollView {
property bool pressed: false
}
}
- property int rowHeight: rowSizeItem.implicitHeight
- property int paddedRowCount: height/rowHeight
+ property int rowHeight: Math.floor(rowSizeItem.implicitHeight)
+ property int paddedRowCount: rowHeight != 0 ? height/rowHeight : 0
y: listView.contentHeight - listView.contentY + listView.originY
width: parent.width