Fixed crash in spectrum analyzer zoom in

Originally committed to SVN as r481.
This commit is contained in:
Rodrigo Braz Monteiro 2006-07-10 20:35:27 +00:00
parent 7674f3cec9
commit f950d58ba5
1 changed files with 1 additions and 1 deletions

View File

@ -541,7 +541,7 @@ void AudioDisplay::DrawSpectrum(wxDC &finaldc,bool weak) {
// Prepare variables
int halfwindow = window/2;
int posThres = int(double(halfwindow-cutOff)/double(h)*0.5/scale + 0.5);
int posThres = MAX(1,int(double(halfwindow-cutOff)/double(h)*0.5/scale + 0.5));
float mult = float(h)/float(halfwindow-cutOff)/255.0f;
// Calculation loop