Blame SOURCES/0013-qqmldelegatemodel-Fix-out-of-bounds-cache-removal.patch

50d94e
From 44ac7f39d874202163926f505a46179c084154b9 Mon Sep 17 00:00:00 2001
b602f4
From: Maximilian Goldstein <max.goldstein@qt.io>
b602f4
Date: Tue, 23 Feb 2021 16:10:44 +0100
50d94e
Subject: [PATCH 13/20] qqmldelegatemodel: Fix out of bounds cache removal
b602f4
b602f4
Pick-to: 5.15 6.0 6.1
b602f4
Task-number: QTBUG-91276
b602f4
Change-Id: I1ddbb4a3326d61ff94e3881beb64a14dade11c46
b602f4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
b602f4
(cherry picked from commit 31ad81d81e623a34cd71567b9507f16601f1c1d4)
b602f4
---
b602f4
 src/qmlmodels/qqmldelegatemodel.cpp | 2 +-
b602f4
 1 file changed, 1 insertion(+), 1 deletion(-)
b602f4
b602f4
diff --git a/src/qmlmodels/qqmldelegatemodel.cpp b/src/qmlmodels/qqmldelegatemodel.cpp
50d94e
index 381726291d..53e511303e 100644
b602f4
--- a/src/qmlmodels/qqmldelegatemodel.cpp
b602f4
+++ b/src/qmlmodels/qqmldelegatemodel.cpp
b602f4
@@ -1621,7 +1621,7 @@ void QQmlDelegateModelPrivate::itemsRemoved(
b602f4
         removed[i] = 0;
b602f4
 
b602f4
     for (const Compositor::Remove &remove : removes) {
b602f4
-        for (; cacheIndex < remove.cacheIndex; ++cacheIndex)
b602f4
+        for (; cacheIndex < remove.cacheIndex && cacheIndex < m_cache.size(); ++cacheIndex)
b602f4
             incrementIndexes(m_cache.at(cacheIndex), m_groupCount, removed);
b602f4
 
b602f4
         for (int i = 1; i < m_groupCount; ++i) {
b602f4
-- 
50d94e
2.35.1
b602f4