aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2021-02-23 16:10:44 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-03-12 11:26:00 +0000
commit6971b1a252497b65c181d02ffac468e73997a9bb (patch)
treeef12f97632c0df3acdf3ca6ef52f75ef6e8dc57e
parent4a2548e3129ecfc2dbe1cabd785a389baadb047d (diff)
qqmldelegatemodel: Fix out of bounds cache removal
Task-number: QTBUG-91276 Change-Id: I1ddbb4a3326d61ff94e3881beb64a14dade11c46 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 31ad81d81e623a34cd71567b9507f16601f1c1d4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qmlmodels/qqmldelegatemodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qmlmodels/qqmldelegatemodel.cpp b/src/qmlmodels/qqmldelegatemodel.cpp
index 5ad56a1710..6db30c5fe6 100644
--- a/src/qmlmodels/qqmldelegatemodel.cpp
+++ b/src/qmlmodels/qqmldelegatemodel.cpp
@@ -1609,7 +1609,7 @@ void QQmlDelegateModelPrivate::itemsRemoved(
removed[i] = 0;
for (const Compositor::Remove &remove : removes) {
- for (; cacheIndex < remove.cacheIndex; ++cacheIndex)
+ for (; cacheIndex < remove.cacheIndex && cacheIndex < m_cache.size(); ++cacheIndex)
incrementIndexes(m_cache.at(cacheIndex), m_groupCount, removed);
for (int i = 1; i < m_groupCount; ++i) {