diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-03-15 13:35:18 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-08-17 09:28:04 +0000 |
commit | 82117639970aa6e2a850a21d082aaab130e59778 (patch) | |
tree | 5992210ce22d95402c25b4572842e9a5c6234638 /src/qml/qml/qqmlproperty.cpp | |
parent | 3513995d8fde7f002977275463fcea1b86f4a693 (diff) |
Don't crash when trying to bind an invalid property index
findAliasTarget() in binding() can result in an invalid index. We do
check for valueTypeIndex below, so we should also check for coreIndex.
Change-Id: I8cfed237666f8c1f8733592d3abd9be5ccee3229
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r-- | src/qml/qml/qqmlproperty.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index 21bbcadb1c..9f1955c4d6 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -798,7 +798,7 @@ QQmlPropertyPrivate::binding(QObject *object, QQmlPropertyIndex index) const int coreIndex = index.coreIndex(); const int valueTypeIndex = index.valueTypeIndex(); - if (!data->hasBindingBit(coreIndex)) + if (coreIndex < 0 || !data->hasBindingBit(coreIndex)) return 0; QQmlAbstractBinding *binding = data->bindings; |