MusicXML import detect corrupted file when the file is minified

• Mar 25, 2021 - 10:10
Reported version
3.1
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project

Version:
OS: macOS 10.16, Arch.: x86_64, MuseScore version (64-bit): 3.6.2.548020600, revision: 3224f34

When I import the file "beautified.musicxml", everything works fine. I get the result "beautified.png".

However when I import the file "minified.musicxml", which should be strictly equivalent, I get the warning
message File "minified.musicxml" corrupted, with the following information:

Measure 3, staff 1 incomplete. Expected: 4/4; Found: 0/1
Measure 4, staff 1 incomplete. Expected: 4/4; Found: 0/1
Measure 5, staff 1 incomplete. Expected: 4/4; Found: 0/1

If I proceed by clicking on "ignore", I get the result "minified.png".

Attachment Size
beautified.musicxml 4.67 KB
minified.musicxml 3.68 KB
minified.png 28.85 KB
beautified.png 39.78 KB

Comments

Regression No Yes
Reported version 3.6 3.5

MuseScore 3.5(.2) fails the same way (on top it duplicates the tempo text and has both visible)

A Debug build (latest 3.x code) dies of a failed assertion (and after having reported the duplicate tempo text):

Debug: Error at line 1 col 1748: duplicate tempo at tick 0 (...\importexport\musicxml\importmxmllogger.cpp:49, void Ms::log(Ms::MxmlLogger::Level, const QString&, const QXmlStreamReader*))
Fatal: ASSERT: "_e.isEndElement() && _e.name() == "notations"" in file ...\importexport\musicxml\importmxmlpass2.cpp, line 6191

Which indicates that it doesn't like <notations><ornaments><mordent/></ornaments></notations>

And it indeed is the missing linefeed after the <mordent/>

There's a rather simple possible fix, from the following code

            else if (_e.name() == "inverted-mordent"
                     || _e.name() == "mordent") {
                  mordentNormalOrInverted();
                  _e.readNext();
                  }

just remove that _e.readNext();

That code came in with 92a39fe

Status PR created fixed

Fixed in branch 3.x, commit b528c8b8dc

_Fix #319210: MusicXML import corrupted when xml is stripped from whitespace

Culprit seems an (empty) `` tag if that is not followed by a newline._

Fix version
4.0.0