changeset 937:24964a8b31e7

Avoid crashing when trying to examine data at column < 0 in 3d model
author Chris Cannam
date Mon, 30 Jun 2014 15:02:43 +0100
parents 0c1d6de8f44b
children 90e9a3f873cf
files data/model/EditableDenseThreeDimensionalModel.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/EditableDenseThreeDimensionalModel.cpp	Wed Jun 18 13:51:16 2014 +0100
+++ b/data/model/EditableDenseThreeDimensionalModel.cpp	Mon Jun 30 15:02:43 2014 +0100
@@ -157,7 +157,7 @@
 EditableDenseThreeDimensionalModel::getColumn(int index) const
 {
     QReadLocker locker(&m_lock);
-    if (int(index) >= m_data.size()) return Column();
+    if (index < 0 || index >= m_data.size()) return Column();
     return expandAndRetrieve(index);
 }