[MusicXML import] empty lyrics lines (was: crash if too many lyrics)

• Jan 29, 2014 - 16:19
P2 - Medium
S3 - Major


I'm not sure it crashes because of too much lyrics, but it does after printing a corresponding message. The crash itself may be unrelated?

Started with -d is additionally gives many

Debug: warning: layout break already set

Edit: I take that back: simply increasing MAX_LYRICS to 16 fixes the crash (this is probably not the fix you're going to pick though ;-))

Something like this maybe?
{syntaxhighlighter brush:cpp}
@@ -3390,10 +3390,12 @@ void MusicXml::xmlLyric(int trk, QDomElement e,
if (lyricNo < 0) {
qDebug("invalid lyrics number (<0)");
delete l;
+ return;
else if (lyricNo > MAX_LYRICS) {
qDebug("too much lyrics (>%d)", MAX_LYRICS);
delete l;
+ return;
else {
numbrdLyrics[lyricNo] = l;

Possibly additionally some detection of empty lyrics, with skipping them?

As a workaround I did increase MAX_LYRICS (as the offending file had many lyrics numbers > 8) and included the return statements.

Empty lyric detection is probably a good idea, but that has not been implemented yet. I can imagine scenarios where simply removing the empty lyric lines may not be correct, so I am not sure the effect is always beneficial.

PR merged in 259b39b
Leaving issue open forthe 'empty lyrics detection'
I do sometimes use an empty lyrics line for formatting purposes, but having 10 of them is certainly not sensible. In the score at Hand here that also wasn#t really the issue, it was some wrong numbering, right? So how could that get detected and corrected?

Title [MusicXML import] crash if too many lyrics [MusicXML import] empty lyrics lines (was: crash if too many lyrics)

Priority lowered to normal, as the crash has been fixed.

How to prevent the empty lyrics lines still to be investigated.