Check that row and column are not less than 0 in indexFromLogical

Change-Id: Icf6dbb234513de12c772618a046461b8674b01ce
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
José Millán Soto 2012-09-26 13:11:35 +02:00 committed by The Qt Project
parent 57fac2e83a
commit dc57295a7b

View 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();
}