Skip to content

Commit

Permalink
fix #297310: Crash on opening Musescore 2.x file that uses leading sp…
Browse files Browse the repository at this point in the history
…ace setting on the initial clef

which seems to not belong to any segment, so dereferences a NULL pointer
leading to a segment violation (pun intended).
The fix simply ignores this, and this avoids the crash, but also looses
the 'visible' property of that clef for some yet unknown reason.
  • Loading branch information
Jojo-Schmitz committed Nov 19, 2019
1 parent d5b7ad7 commit f7d9401
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libmscore/read206.cpp
Expand Up @@ -3330,8 +3330,10 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e)
beam->setParent(0);
e.addBeam(beam);
}
else if (tag == "Segment")
segment->read(e);
else if (tag == "Segment") {
if (segment) segment->read(e);
else e.unknown();
}
else if (tag == "MeasureNumber") {
MeasureNumber* noText = new MeasureNumber(score);
readText206(e, noText, m);
Expand Down

0 comments on commit f7d9401

Please sign in to comment.