Improve sanity check for DivePlotDataModel::data()
Adds DivePlotDataModel row upper-boundary check (isValid method already checks for negative values). Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3e41047d41
commit
e7eb06d78c
@ -20,7 +20,7 @@ int DivePlotDataModel::columnCount(const QModelIndex& parent) const
|
||||
|
||||
QVariant DivePlotDataModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
if ((!index.isValid())||(index.row() >= pInfo.nr))
|
||||
return QVariant();
|
||||
|
||||
plot_data item = pInfo.entry[index.row()];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user