Skip to content

Commit

Permalink
Merge pull request #23946 from miiizen/tuplet-xml-crash
Browse files Browse the repository at this point in the history
Fix nested tuplet crash
  • Loading branch information
miiizen authored Aug 9, 2024
2 parents c0c02e1 + e67caa7 commit 6d84375
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,11 @@ static void handleTupletStop(Tuplet*& tuplet, const int normalNotes)
tuplet->setBaseLen(td);
Fraction f(normalNotes, td.fraction().denominator());
f.reduce();
if (!f.isValid()) {
LOGD("MusicXML::import: tuplet stop but note values too small");
tuplet = nullptr;
return;
}
tuplet->setTicks(f);
// TODO determine usefulness of following check
int totalDuration = 0;
Expand Down

0 comments on commit 6d84375

Please sign in to comment.