mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-29 06:38:38 +02:00
Fix for keyboard clip commands
Fix bug in AudacityProject::AdjustForFindingStartTimes. Bug: When there is 0 or 1 clips, q - 2 is before the begin() of the vector, and caused crash. Fix: split the test into two tests.
This commit is contained in:
parent
6c0e8c7d86
commit
495755b074
@ -6631,7 +6631,7 @@ double AudacityProject::AdjustForFindingStartTimes(const std::vector<const WaveC
|
||||
{
|
||||
auto q = std::find_if(clips.begin(), clips.end(), [&] (const WaveClip* const& clip) {
|
||||
return clip->GetEndTime() == time; });
|
||||
if (q <= clips.end() - 2 &&
|
||||
if (q != clips.end() && q + 1 != clips.end() &&
|
||||
(*q)->GetEndSample() == (*(q+1))->GetStartSample()) {
|
||||
time = (*(q+1))->GetStartTime();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user