Crash on opening a particular 1.X score

• Jul 8, 2019 - 08:54
Reported version
3.2
Priority
P1 - High
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project

1) Download and open this score: https://musescore.com/user/1239061/scores/543841
Result: crash


Comments

The crash occurs inside Chord::pagePos() while trying to determine the System associated with a Chord for which isGrace() happens to be true. It is assumed that the parent of such a Chord is another Chord, but the actual parent object turns out to be a Segment instead. The crash can be prevented by simplifying these two lines:

            const Chord* pc = static_cast<const Chord*>(parent());
            System* system = pc->segment()->system();

to just this line:

            System* system = segment()->system();

since the grace chord's segment should be on the same system as the parent chord's segment, and we don’t need the parent chord for anything else. However, this may be an indication that there is something wrong with the way that grace chords are added to a score upon import from 1.x.