Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when opening MusicXML file with multiple fermatas on grace notes #26680

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cbjeukendrup
Copy link
Contributor

@cbjeukendrup cbjeukendrup commented Feb 22, 2025

Resolves: #26593

See ChordRest::add/removeFermata and their usages: when reading a MusicXML file where there is a fermata on a grace note, the fermata is temporarily added to the grace chord, because there is no segment yet, and then later it is moved to the segment, which becomes the definitive parent of the fermata. If a MusicXML file contains multiple fermatas on one grace note, then those fermatas except the first would not be moved from the grace chord to the segment. This means that there are fermatas with no segment encountered during layout when going through that grace chord's el(), which causes a crash. The solution for now is to ensure that all fermatas are moved. A more definitive solution in the future might be to refactor out the add/removeFermata methods, because as the comment at their declaration already says, they really look like a hack.

Inspired by the investigation at #26602.

…rd to segment

Resolves: musescore#26593

If a MusicXML file contains multiple fermatas on one grace note, then those fermatas except the first would not be moved from the grace chord to the segment. This means that there are fermatas with no segment encountered during layout when going through that grace chord's `el()`, which causes a crash.

Inspired by the investigation at musescore#26602.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault when opening a specific MusicXML score
1 participant