Skip to content

Commit

Permalink
Allow 128th as the shortest actual measure duration
Browse files Browse the repository at this point in the history
and report an error rather than crash
if the score has something shorter

See musescore#8890 and musescore#8893, backport of musescore#8894, part 1
  • Loading branch information
Jojo-Schmitz committed Sep 23, 2021
1 parent 762cb75 commit b10d857
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2022,7 +2022,7 @@ void Measure::read(XmlReader& e, int staffIdx)
else
qDebug("illegal measure size <%s>", qPrintable(e.attribute("len")));
irregular = true;
if (_len.numerator() <= 0 || _len.denominator() <= 0) {
if (_len.numerator() <= 0 || _len.denominator() <= 0 || _len.denominator() > 128) {
e.raiseError(QObject::tr("MSCX error at line %1: invalid measure length: %2").arg(e.lineNumber()).arg(_len.toString()));
return;
}
Expand Down
5 changes: 5 additions & 0 deletions mscore/measureproperties.ui
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@
<string>64</string>
</property>
</item>
<item>
<property name="text">
<string>128</string>
</property>
</item>
</widget>
</item>
<item row="0" column="4" colspan="2">
Expand Down

0 comments on commit b10d857

Please sign in to comment.