1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-05 14:49:25 +02:00

Bug2170: Crash using Trim twice with unchanged selection...

... bug resulted from Envelope rewrites in 2.2.0 and not recent restructurings.
This commit is contained in:
Paul Licameli 2019-07-22 15:10:03 -04:00
parent d6768f9112
commit e0fc7e7980

View File

@ -420,7 +420,12 @@ void Envelope::CollapseRegion( double t0, double t1, double sampleDur )
// We will keep the last (or only) point that was at t1.
--end;
mEnv.erase( mEnv.begin() + begin, mEnv.begin() + end );
if ( end < begin ) {
if ( leftPoint )
rightPoint = false;
}
else
mEnv.erase( mEnv.begin() + begin, mEnv.begin() + end );
// Shift points left after deleted region.
auto len = mEnv.size();