diff --git a/src/core/Sample.cpp b/src/core/Sample.cpp index 9d25d28d6..c8ee9251a 100644 --- a/src/core/Sample.cpp +++ b/src/core/Sample.cpp @@ -185,7 +185,7 @@ void Sample::visualize(QPainter& p, const QRect& dr, int fromFrame, int toFrame) // the width, so we will have width points, or nbFrames is // smaller than the width (fpp = 1) and we will have nbFrames // points - const int totalPoints = nbFrames > w ? w : nbFrames; + const int totalPoints = std::min(nbFrames, w); std::vector fEdgeMax(totalPoints); std::vector fEdgeMin(totalPoints); std::vector fRmsMax(totalPoints);