# HG changeset patch # User Chris Cannam # Date 1409741623 -3600 # Node ID 99f96cacde36dbcfbbe8d81c2032ebd56b6f17a8 # Parent 6c6e34b096887aa27caf6ec80606f31b7263812a Fix some potential divide by zeros (from coverity scan) diff -r 6c6e34b09688 -r 99f96cacde36 layer/WaveformLayer.cpp --- a/layer/WaveformLayer.cpp Wed Sep 03 11:51:51 2014 +0100 +++ b/layer/WaveformLayer.cpp Wed Sep 03 11:53:43 2014 +0100 @@ -46,7 +46,8 @@ m_middleLineHeight(0.5), m_aggressive(false), m_cache(0), - m_cacheValid(false) + m_cacheValid(false), + m_cacheZoomLevel(0) { } @@ -1042,7 +1043,7 @@ channels = getChannelArrangement(minChannel, maxChannel, mergingChannels, mixingChannels); - + if (channels == 0) return 0; if (maxChannel < minChannel || channel < minChannel) return 0; int h = v->height(); @@ -1085,7 +1086,7 @@ channels = getChannelArrangement(minChannel, maxChannel, mergingChannels, mixingChannels); - + if (channels == 0) return 0; if (maxChannel < minChannel) return 0; int h = v->height();