Mercurial > hg > svgui
diff layer/SliceLayer.cpp @ 860:4a5d144bd5d0 tonioni
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 16:36:21 +0100 |
parents | 312b92ffb04e |
children | 12ab113ca2b1 |
line wrap: on
line diff
--- a/layer/SliceLayer.cpp Tue Sep 02 16:23:48 2014 +0100 +++ b/layer/SliceLayer.cpp Tue Sep 09 16:36:21 2014 +0100 @@ -396,7 +396,9 @@ float max = 0.f; for (int bin = 0; bin < mh; ++bin) { - if (m_samplingMode == SampleMean) m_values[bin] /= divisor; + if (m_samplingMode == SampleMean && divisor > 0) { + m_values[bin] /= divisor; + } if (m_values[bin] > max) max = m_values[bin]; } if (max != 0.f && m_normalize) {