Page MenuHomePhabricator

Crash with bin size 0 in statistics
Closed, ResolvedPublic

Description

To reproduce:
-load any image
-open the statistic
-disable "use default bin size"
-set bin size to 0
-> Crash

Event Timeline

kilgus added a subscriber: kilgus.

Here is my stack trace:

0 itk::Statistics::Histogram<double, itk::Statistics::DenseFrequencyContainer2>::GetIndex itkHistogram.hxx 293 0x7fffbb39a78a
1 itk::Statistics::SampleToHistogramFilter<itk::Statistics::ImageToListSampleAdaptor<itk::Image<short, 3u> >, itk::Statistics::Histogram<double, itk::Statistics::DenseFrequencyContainer2> >::GenerateData itkSampleToHistogramFilter.hxx 314 0x7fffbb355d38
2 itk::ProcessObject::UpdateOutputData itkProcessObject.cxx 1733 0x7ffff565f039
3 itk::DataObject::UpdateOutputData itkDataObject.cxx 416 0x7ffff56738c5
4 itk::DataObject::Update itkDataObject.cxx 341 0x7ffff567355d
5 itk::ProcessObject::Update itkProcessObject.cxx 1314 0x7ffff565df20
6 itk::Statistics::ScalarImageToHistogramGenerator<itk::Image<short, 3u> >::Compute itkScalarImageToHistogramGenerator.hxx 57 0x7fffbb0d989f
7 mitk::ImageStatisticsCalculator::InternalCalculateStatisticsUnmasked<short, 3u> mitkImageStatisticsCalculator.cpp 1089 0x7fffbb08f1c8
8 mitk::ImageStatisticsCalculator::ComputeStatistics mitkImageStatisticsCalculator.cpp 605 0x7fffbb07a3c5
9 QmitkImageStatisticsCalculationThread::run QmitkImageStatisticsCalculationThread.cpp 171 0x7fff959bc1e3
10 ?? /usr/lib/x86_64-linux-gnu/libQtCore.so.4 0x7ffff6fd232f
11 start_thread pthread_create.c 312 0x7ffff53a5182
12 clone clone.S 111 0x7ffff4bb7fbd

This is just a matter of input sanitation. Fixed the QSpinBox to only accept values > 0

User maerz has pushed new remote branch:

bug-18337-CrashWithBinSize0InStatistics

[c49c3b]: Merge branch 'bug-18337-CrashWithBinSize0InStatistics'

Merged commits:

2014-10-22 14:59:13 Keno März [6d5237]
bin size Widget only accepts values > 0 to prevent crash