From 5f71e334dc7b7e7f60229ed5c69a950a2ca52b95 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Jun 2015 16:53:39 -0400 Subject: [PATCH] Bug999: top bin of spectrogram display --- src/TrackArtist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index 55973da27..b72181c7d 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -1843,8 +1843,8 @@ static inline float findValue half; // Maximum method, and no apportionment of any single bins over multiple pixel rows // See Bug971 - int bin = floor(0.5 + bin0); - const int limitBin = floor(0.5 + bin1); + int bin = std::min(half - 1, int(floor(0.5 + bin0))); + const int limitBin = std::min(half, int(floor(0.5 + bin1))); value = spectrum[bin]; while (++bin < limitBin) value = std::max(value, spectrum[bin]);