Skip to content

Commit

Permalink
Merge pull request #6183 from njvdberg/issue-302573-crash-undo-instru…
Browse files Browse the repository at this point in the history
…ments

Fix #302573 - Crash undoing add instruments
  • Loading branch information
anatoly-os authored Jun 9, 2020
2 parents 7bbcb88 + 954aed8 commit 13793f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5307,8 +5307,9 @@ static bool needViewportMove(Score* cs, ScoreView* cv)
mEnd = mEnd ? mEnd->nextMeasureMM() : nullptr;

const bool isExcerpt = !cs->isMaster();
const int startStaff = (isExcerpt || state.startStaff() < 0) ? 0 : state.startStaff();
const int endStaff = (isExcerpt || state.endStaff() < 0) ? (cs->nstaves() - 1) : state.endStaff();
const bool csStaves = (isExcerpt || (state.endStaff() < 0) || (state.endStaff() >= cs->nstaves()));
const int startStaff = csStaves ? 0 : state.startStaff();
const int endStaff = csStaves ? (cs->nstaves() - 1) : state.endStaff();

for (Measure* m = mStart; m && m != mEnd; m = m->nextMeasureMM()) {
for (int st = startStaff; st <= endStaff; ++st) {
Expand Down

0 comments on commit 13793f9

Please sign in to comment.