er... ACTUALLY fixed it now.

Originally committed to SVN as r1768.
This commit is contained in:
Rodrigo Braz Monteiro 2008-01-18 18:36:52 +00:00
parent e84071395a
commit e5439a03fe
1 changed files with 1 additions and 1 deletions

View File

@ -577,7 +577,7 @@ void AudioSpectrum::RenderRange(int64_t range_start, int64_t range_end, bool sel
// Iterate over pixels, picking a range of samples for each // Iterate over pixels, picking a range of samples for each
for (int y = 0; y < imgheight; ++y) { for (int y = 0; y < imgheight; ++y) {
int sample1 = MAX(0,maxband * y/imgheight + minband); int sample1 = MAX(0,maxband * y/imgheight + minband);
int sample2 = MIN(signed(line_length),maxband * (y+1)/imgheight + minband); int sample2 = MIN(signed(line_length-1),maxband * (y+1)/imgheight + minband);
float maxval = 0; float maxval = 0;
for (int samp = sample1; samp <= sample2; samp++) { for (int samp = sample1; samp <= sample2; samp++) {
if (power[samp] > maxval) maxval = power[samp]; if (power[samp] > maxval) maxval = power[samp];