Files
ResInsight/ApplicationLibCode/ResultStatisticsCache
Magne Sjaastad c9cd10e836 Guard against zero or negative histogram bin count
The "Number of Bins" field accepts any integer. With 0 bins the histogram
vector is resized to zero and m_maxIndex wraps to SIZE_MAX, so addValue()
writes histogram[0] on an empty vector. Set a minimum value of 1 on the
bin count fields of the histogram data sources (also clamping values read
from project files), and treat 0 bins as a single bin in
RigHistogramCalculator.

Crash stack (signature 0a750847b697):
[3] RigHistogramCalculator::addValue(double) at RigStatisticsMath.cpp:546
[5] RimEnsembleSummaryVectorHistogramDataSource::compute(...) const at RimEnsembleSummaryVectorHistogramDataSource.cpp:255
[6] RimHistogramCurve::onLoadDataAndUpdate(bool) at RimHistogramCurve.cpp:365
[11] caf::PdmFieldUiCap<caf::PdmField<int> >::setValueFromUiEditor(QVariant const&, bool)
2026-11-02 09:37:52 +01:00
..