This commit is contained in:
2019-11-12 16:15:15 +01:00
parent f08f71e747
commit 82a99e562c

View File

@@ -69,8 +69,11 @@ void HistogramChart::pushData(qreal value)
else if (value > maxValue) { else if (value > maxValue) {
int newMaxIndex = binIndex(value); int newMaxIndex = binIndex(value);
Q_ASSERT(newMaxIndex > 0); Q_ASSERT(newMaxIndex >= 0);
_histogram.resize(static_cast<size_t>(newMaxIndex + 1));
if (newMaxIndex > 0) {
_histogram.resize(static_cast<size_t>(newMaxIndex + 1));
}
maxValue = value; maxValue = value;
} }