1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-23 07:58:05 +02:00

Fix possible assertion violations for cut, paste, trim

This commit is contained in:
Paul Licameli 2017-04-29 15:39:41 -04:00
parent 615a5058a7
commit b2b9708b29
2 changed files with 3 additions and 3 deletions

View File

@ -495,7 +495,7 @@ bool NoteTrack::Trim(double t0, double t1)
void NoteTrack::Clear(double t0, double t1)
{
if (t1 <= t0)
if (t1 < t0)
THROW_INCONSISTENCY_EXCEPTION;
double len = t1-t0;

View File

@ -634,10 +634,10 @@ void WaveTrack::Trim (double t0, double t1)
//if inside0 is false, then the left selector was between
//clips, so DELETE everything to its left.
if(false == inside1)
if(!inside1 && t1 < GetEndTime())
Clear(t1,GetEndTime());
if(false == inside0)
if(!inside0)
SplitDelete(0,t0);
}