Check that row and column are not less than 0 in indexFromLogical
authorJosé Millán Soto <fid@gpul.org>
Wed, 26 Sep 2012 11:11:35 +0000 (13:11 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sat, 13 Oct 2012 03:51:19 +0000 (05:51 +0200)
Change-Id: Icf6dbb234513de12c772618a046461b8674b01ce
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
src/plugins/accessible/widgets/itemviews.cpp

index a8c42c9..649863e 100644 (file)
@@ -407,7 +407,7 @@ QModelIndex QAccessibleTree::indexFromLogical(int row, int column) const
         return QModelIndex();
 
     const QTreeView *treeView = qobject_cast<const QTreeView*>(view());
-    if (treeView->d_func()->viewItems.count() <= row) {
+    if ((row < 0) || (column < 0) || (treeView->d_func()->viewItems.count() <= row)) {
         qWarning() << "QAccessibleTree::indexFromLogical: invalid index: " << row << column << " for " << treeView;
         return QModelIndex();
     }