File: 15-crash-mxml.diff

package info (click to toggle)
musescore3 3.2.3%2Bdfsg2-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 218,192 kB
  • sloc: cpp: 291,369; xml: 200,226; sh: 3,779; ansic: 1,447; python: 393; makefile: 249; perl: 82; pascal: 79
file content (23 lines) | stat: -rw-r--r-- 1,177 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Origin: upstream, commit:4857c4117ae2bf0829ede78c3572801f5c4fee73
Author: Leon Vinken <leon.vinken@gmail.com>
Description: fix #287475 - crash on open MusicXML file lacking time signature

--- a/mscore/importmxmlpass1.cpp
+++ b/mscore/importmxmlpass1.cpp
@@ -2054,11 +2054,15 @@ void MusicXMLParserPass1::measure(const
       // measure duration fixups
       mDura.reduce();
 
-      // fix for PDFtoMusic Pro v1.3.0d Build BF4E (which sometimes generates empty measures)
+      // fix for PDFtoMusic Pro v1.3.0d Build BF4E and PlayScore / ReadScoreLib Version 3.11
+      // which sometimes generate empty measures
       // if no valid length found and length according to time signature is known,
       // use length according to time signature
       if (mDura.isZero() && _timeSigDura.isValid() && _timeSigDura > Fraction(0, 1))
             mDura = _timeSigDura;
+      // if no valid length found and time signature is unknown, use default
+      if (mDura.isZero() && !_timeSigDura.isValid())
+            mDura = Fraction(4, 4);
 
       // if necessary, round up to an integral number of 1/64s,
       // to comply with MuseScores actual measure length constraints