Opening a score createted via "Save selection" of a linked staff causes a crash

• Jun 25, 2015 - 08:47
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Nightly c3c1b81 / Windows7

1) New score with two linked staves
2) Input some notes in two measures
3) Select eg the first measure of the top staff, or the second staff (no crash if you select both the staves)
4) File -> Save selection -> Save
5) Load the new file

Result: crash

First reported on this thread : https://musescore.org/en/node/66516
For location of this issue, see comment #2


Comments

Stack trace:
0 Ms::Staff::invisible staff.h 184 0xbcded4
1 Ms::Measure::read measure.cpp 1755 0x7bbd85
2 Ms::Score::readStaff scorefile.cpp 270 0x7fd5a8
3 Ms::Score::read scorefile.cpp 966 0x8018e0
4 Ms::Score::read1 scorefile.cpp 911 0x80156a
5 Ms::Score::loadCompressedMsc scorefile.cpp 759 0x8007de
6 Ms::Score::loadMsc scorefile.cpp 806 0x800a6b
7 Ms::readScore file.cpp 2105 0x58d321
8 Ms::MuseScore::readScore file.cpp 328 0x57e246
9 Ms::MuseScore::dropEvent musescore.cpp 1524 0x4841a5
10 ZN7QWidget5eventEP6QEvent 0x61e0bc22
11 ?? 0xc0

measure.cpp, line 1755 calls

s->lines->setVisible(!staff->invisible());

with staff being NULL

Would that get fixed, it would later crash on line 1778:

Fraction timeStretch(staff->timeStretch(tick());

for the same reason (staff being NULL)

And with that being fixed it dies with

Fatal: ASSERT failure in QList::operator[]: "index out of range", file C:/Qt/5.4/mingw491_32/include/QtCore/qlist.h, line 486 (:0, )

Well, it fixed the creation of such broken score, not the crash on opening them, does it?
Shouldn't we al least add a check for a missing 'part' section to the sanity check, so we can report such a score as being corrupt?