Crash when playing with lead-in in a score with repeats

• Mar 29, 2015 - 18:10
Type
Functional
Severity
S2 - Critical
Status
closed
Project

a249aea1

  1. Open this file
  2. mark first note in bar 38.
  3. View > Play Panel > Press "Play count-in at playback start"
  4. Then "play"

MuseScore crashes.

A quick investigation shows that it's due to the repeats. A workaround is to deactivate the repeats in the toolbar next to the play button.


Comments

The problem arises in mscore/seq.cpp, at lines 617-618:
https://github.com/musescore/MuseScore/blob/master/mscore/seq.cpp#L617
{syntaxhighlighter brush:c++;first-line:617;} int plPos = playPos->first;
Measure* m = cs->tick2measure(plPos);{/syntaxhighlighter}
In this case playPos is 84480, but there is no measure at tick 84480 (the final tick is 76800) so m is 0; the playPos refers to the case of "unrolled" repeates.
Is this a difference between "tick" and "utick"?

Linux Mint 17.1, commit a249aea19

What about substituting line 617 of mscore/seq.cpp (see above) with:
{syntaxhighlighter brush:c++;first-line:617;}int plPos = cs->playPos();{/syntaxhighlighter}
(i.e. cs->playPos() instead of playPos->first)?
I tested it and it seems to work fine, but I am not familiar enough with this part of the code.