[MusicXML import] crash on empty credit-words

• Feb 27, 2020 - 08:01
Reported version
3.x-dev
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
Yes
Project

Self build (current)
OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.5.0, revision: 546fcee

Repro steps:
1. Import the attached XML
MusicXML-import-parts.png

Expected behaviour: A new score should open
Actual behaviour: Nothing happens in the UI. Following debug string is traced:
str = Error at line 67 col 15: MusicXMLParserPass2::part cannot find part 'P1'
and then a null pointer exception is thrown in line 1571 of importmxmlpass2.cpp

Attachment Size
MusicXML-import-parts.xml 7.89 KB

Comments

MusicXML got generated by "CapToMusic.py CapXML to MusicXML converter version 1.4"
And it generated an empty credit-words, which seems the culprit fot this crash

   <credit>
        <credit-words></credit-words>
    </credit>

as changing that to

   <credit>
        <credit-words>hello</credit-words>
    </credit>

and the crash won't happen, but import the xml cleanly

On
<credit>
    <credit-words></credit-words>
/credit>
<part-list>
    <part-group type="start" number="1">
    ..

QXmlStreamReader::skipCurrentElement() moves from credit to part-group.

But on
<credit>
    <credit-words>abc</credit-words>
/credit>
<part-list>
    <part-group type="start" number="1">
    ..

it moves to part-list

Barline spansrequires an element group-barline with value yes as child of part-group, but group-barline is not present. Note that even when adding it, MuseScore does not handle it, which may be a bug.

So it is MuseScore, not the import that makes the different span between the bar at the end of the first line and the final bar?
I will write a bug. Thank you!

Fix version
3.5.0