Skip to content

Commit

Permalink
Fix a playback crash if the score contained a Fine symbol
Browse files Browse the repository at this point in the history
Fixes: #470
  • Loading branch information
cameronwhite committed Mar 30, 2024
1 parent c56f844 commit 3161cb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Thanks to the following contributors who worked on this release:
- Fixed a bug where the caret was rendered when printing or displaying a print preview (#441)
- Fixed issues where the top fret number of a chord diagram could be cut off in the chord name dialog (#408)
- Fixed a crash when an alternate ending was located on the last position of a system (#449)
- Fixed a crash during playback when a score contained a `Fine` symbol (#470)

## [Alpha 19] - 2022-10-17

Expand Down
9 changes: 2 additions & 7 deletions source/score/utils/directionindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,10 @@ SystemLocation DirectionIndex::performDirection(

SystemLocation DirectionIndex::followDirection(DirectionSymbol::SymbolType type)
{
// Go to the end of the score.
if (type == DirectionSymbol::Fine)
{
const auto lastSystemIndex = myScore.getSystems().size() - 1;
return SystemLocation(static_cast<int>(lastSystemIndex),
myScore.getSystems()[lastSystemIndex]
.getBarlines()
.back()
.getPosition());
// Go to the end of the score to stop playback.
return SystemLocation(static_cast<int>(myScore.getSystems().size()), 0);
}

DirectionSymbol::SymbolType nextSymbol = DirectionSymbol::Coda;
Expand Down

0 comments on commit 3161cb0

Please sign in to comment.