1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 16:48:44 +02:00

Fix the previous fix! ... in copying of wave clip display caches.

This commit is contained in:
Paul Licameli 2016-10-01 10:15:33 -04:00
parent a41eb4422c
commit 921b769b52

View File

@ -569,9 +569,9 @@ bool WaveClip::GetWaveDisplay(WaveDisplay &display, double t0,
// possibly out of bounds. // possibly out of bounds.
// For what range of pixels can data be copied? // For what range of pixels can data be copied?
copyBegin = std::min<size_t>(numPixels, std::max(0, -oldX0)); copyBegin = std::min<size_t>(numPixels, std::max(0, -oldX0));
copyEnd = std::min<size_t>(numPixels, copyEnd = std::min<size_t>(numPixels, std::max(0,
std::max(0, (int)oldCache->len - std::max(0, oldX0)) (int)oldCache->len - oldX0
); ));
} }
if (!(copyEnd > copyBegin)) if (!(copyEnd > copyBegin))
oldCache.reset(0); oldCache.reset(0);
@ -1172,9 +1172,9 @@ bool WaveClip::GetSpectrogram(WaveTrackCache &waveTrackCache,
// possibly out of bounds. // possibly out of bounds.
// For what range of pixels can data be copied? // For what range of pixels can data be copied?
copyBegin = std::min((int)numPixels, std::max(0, -oldX0)); copyBegin = std::min((int)numPixels, std::max(0, -oldX0));
copyEnd = std::min((int)numPixels, copyEnd = std::min((int)numPixels, std::max(0,
(int)oldCache->len - std::max(0, oldX0) (int)oldCache->len - oldX0
); ));
} }
if (!(copyEnd > copyBegin)) if (!(copyEnd > copyBegin))