Skip to content

Commit

Permalink
Fix: Crash when re-applying time signature to parts (out of bounds)
Browse files Browse the repository at this point in the history
  • Loading branch information
worldwideweary authored and Jojo-Schmitz committed Sep 12, 2024
1 parent 78c2a4a commit 10d1b80
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions libmscore/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2252,12 +2252,15 @@ void Score::deleteMeasures(MeasureBase* is, MeasureBase* ie, bool preserveTies)
if (!s)
s = mAfterSel->undoGetSegment(SegmentType::TimeSig, mAfterSel->tick());

TimeSig* nts = new TimeSig(this);
nts->setTrack(staffIdx * VOICES);
nts->setParent(s);
nts->setFrom(lastDeletedForThisStaff);
nts->setStretch(nts->sig() / mAfterSel->timesig());
score->undoAddElement(nts);
size_t track = staffIdx * VOICES;
if (track < s->elist().size()) {
TimeSig* nts = new TimeSig(score);
nts->setTrack(track);
nts->setParent(s);
nts->setSig(lastDeletedForThisStaff->sig());
nts->setStretch(nts->sig() / mAfterSel->timesig());
score->undoAddElement(nts);
}
}
}

Expand Down

0 comments on commit 10d1b80

Please sign in to comment.