diff --git a/aegisub/src/audio_renderer_spectrum.cpp b/aegisub/src/audio_renderer_spectrum.cpp index fb6b5542d..b05f6ee59 100644 --- a/aegisub/src/audio_renderer_spectrum.cpp +++ b/aegisub/src/audio_renderer_spectrum.cpp @@ -294,9 +294,7 @@ void AudioSpectrumRenderer::Render(wxBitmap &bmp, int start, AudioRenderingStyle assert(px < imgdata + imgheight*stride); int sample1 = std::max(0, maxband * y/imgheight + minband); int sample2 = std::min((1< maxval) maxval = power[samp]; + float maxval = *std::max_element(&power[sample1], &power[sample2 + 1]); pal->map(maxval*amplitude_scale, px); px -= stride; }