aboutsummaryrefslogtreecommitdiffstats
path: root/src
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-30 20:55:36 +0000
commit52feae162b305d70f3009bfd30913fa458ec628e (patch)
tree317d1f1aa34e042d5265cbac94ab6638d56e455f /src
parent4a8942cc1fbd168949bc2b4f2d83a326eaeca8d9 (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>
Diffstat (limited to 'src')
-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 303ca0e2e4..7ef07e6352 100644
--- a/src/qmlmodels/qqmldelegatemodel.cpp
+++ b/src/qmlmodels/qqmldelegatemodel.cpp
@@ -1606,7 +1606,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) {