summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Bugge Monsen <mmonsen@trolltech.com>2009-08-27 15:57:52 +0200
committerMarius Bugge Monsen <mmonsen@trolltech.com>2009-08-27 15:57:52 +0200
commita5e91d977f3dc663d40945db3ccdfa7a71086e6e (patch)
tree00ecba9bef0f08a5f85b734b4efc2bfefeb9072b
parent5a960d99198a9396618dfeed179ca58711adee48 (diff)
Fix out-of-bounds lookup in QtListSelectionChangeData::changedIndexes().
-rw-r--r--src/qlistselectionmanager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qlistselectionmanager.cpp b/src/qlistselectionmanager.cpp
index 43d68a9..d947c15 100644
--- a/src/qlistselectionmanager.cpp
+++ b/src/qlistselectionmanager.cpp
@@ -99,13 +99,13 @@ QList<int> QtListSelectionChangeData::changedIndexes() const
bool oldSelect = false;
if (previousRange.first <= i && i <= previousRange.second)
oldSelect = (toggle ? !previousSelections.testBit(i) : true);
- else
+ else if (0 <= i && i < previousSelections.count())
oldSelect = previousSelections.testBit(i);
// new selection value
bool newSelect = false;
if (currentRange.first <= i && i <= currentRange.second)
newSelect = (toggle ? !currentSelections.testBit(i) : true);
- else
+ else if (0 <= i && i < currentSelections.count())
newSelect = currentSelections.testBit(i);
// compare old and new
if (oldSelect != newSelect)