comparison data/model/EditableDenseThreeDimensionalModel.cpp @ 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 df82da55e86a
children 5bd05a24e32a
comparison
equal deleted inserted replaced
936:0c1d6de8f44b 937:24964a8b31e7
155 155
156 EditableDenseThreeDimensionalModel::Column 156 EditableDenseThreeDimensionalModel::Column
157 EditableDenseThreeDimensionalModel::getColumn(int index) const 157 EditableDenseThreeDimensionalModel::getColumn(int index) const
158 { 158 {
159 QReadLocker locker(&m_lock); 159 QReadLocker locker(&m_lock);
160 if (int(index) >= m_data.size()) return Column(); 160 if (index < 0 || index >= m_data.size()) return Column();
161 return expandAndRetrieve(index); 161 return expandAndRetrieve(index);
162 } 162 }
163 163
164 float 164 float
165 EditableDenseThreeDimensionalModel::getValueAt(int index, int n) const 165 EditableDenseThreeDimensionalModel::getValueAt(int index, int n) const