index is still invalid if its row equals the number of resolutions
authorMohammed Sameer <msameer@foolab.org>
Wed, 26 Sep 2012 17:45:53 +0000 (20:45 +0300)
committerMohammed Sameer <msameer@foolab.org>
Wed, 26 Sep 2012 17:45:53 +0000 (20:45 +0300)
imports/imageresolutionmodel.cpp
imports/videoresolutionmodel.cpp

index 47b16b0..4ba775e 100644 (file)
@@ -53,7 +53,7 @@ int ImageResolutionModel::rowCount(const QModelIndex& parent) const {
 }
 
 QVariant ImageResolutionModel::data(const QModelIndex& index, int role) const {
-  if (index.row() < 0 || index.row() > m_resolutions.size()) {
+  if (index.row() < 0 || index.row() >= m_resolutions.size()) {
     return QVariant();
   }
 
index 0817077..d7aefe8 100644 (file)
@@ -53,7 +53,7 @@ int VideoResolutionModel::rowCount(const QModelIndex& parent) const {
 }
 
 QVariant VideoResolutionModel::data(const QModelIndex& index, int role) const {
-  if (index.row() < 0 || index.row() > m_resolutions.size()) {
+  if (index.row() < 0 || index.row() >= m_resolutions.size()) {
     return QVariant();
   }