aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2024-04-11 12:06:13 +0300
committerKaj Grönholm <kaj.gronholm@qt.io>2024-04-12 21:32:59 +0300
commitb31bfde4bd840a94cdd4b2223e8f7c345850bd66 (patch)
tree940889e1f7da127d02eb0b5e9c8336c53b30e766 /src/quick
parent99c7fe45be00b694da4041c5a06e5484f2985dc6 (diff)
Make sure PathView index isn't negative when filling the model
Pick-to: 6.7 6.5 Fixes: QTBUG-46487 Change-Id: Iba2a875756f0c06b86bb0a0aaf66eac329b2382b Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickpathview.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index 3b1f953208..ce61543f42 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -2025,6 +2025,7 @@ void QQuickPathView::refill()
startPos = d->highlightRangeStart;
// With no items, then "end" is just off the top so we populate via append
endIdx = (qRound(d->modelCount - d->offset) - 1) % d->modelCount;
+ endIdx = qMax(-1, endIdx); // endIdx shouldn't be smaller than -1
endPos = d->positionOfIndex(endIdx);
}
//Append