From 03984c48a5e5792146d1ca4ac708cb83d2303339 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sat, 25 Jul 2015 19:58:24 -0400 Subject: [PATCH] Bug1096: Fix crash changing view types --- src/TrackArtist.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index 993556367..98ccd6b3d 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -1661,9 +1661,9 @@ void FindWavePortions for (int left = rect.x; left < rightmost;) { while (it != end && it->position <= left) prev = it++; - const int right = std::max(left, int( - it != end ? it->position : rightmost - )); + if (it == end) + break; + const int right = std::max(left, int(it->position)); const int width = right - left; if (width > 0) portions.push_back(