From 921b769b5261b5aa656565ce46c2a4fa4773cc9d Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sat, 1 Oct 2016 10:15:33 -0400 Subject: [PATCH] Fix the previous fix! ... in copying of wave clip display caches. --- src/WaveClip.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WaveClip.cpp b/src/WaveClip.cpp index 9e3096d9c..479d79d68 100644 --- a/src/WaveClip.cpp +++ b/src/WaveClip.cpp @@ -569,9 +569,9 @@ bool WaveClip::GetWaveDisplay(WaveDisplay &display, double t0, // possibly out of bounds. // For what range of pixels can data be copied? copyBegin = std::min(numPixels, std::max(0, -oldX0)); - copyEnd = std::min(numPixels, - std::max(0, (int)oldCache->len - std::max(0, oldX0)) - ); + copyEnd = std::min(numPixels, std::max(0, + (int)oldCache->len - oldX0 + )); } if (!(copyEnd > copyBegin)) oldCache.reset(0); @@ -1172,9 +1172,9 @@ bool WaveClip::GetSpectrogram(WaveTrackCache &waveTrackCache, // possibly out of bounds. // For what range of pixels can data be copied? copyBegin = std::min((int)numPixels, std::max(0, -oldX0)); - copyEnd = std::min((int)numPixels, - (int)oldCache->len - std::max(0, oldX0) - ); + copyEnd = std::min((int)numPixels, std::max(0, + (int)oldCache->len - oldX0 + )); } if (!(copyEnd > copyBegin))