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 #309852: undefined playback of chord symbol attached to fret diagram #6521

Merged
merged 1 commit into from
Sep 1, 2020

Conversation

MarcSabatella
Copy link
Contributor

Resolves: https://musescore.org/en/node/309852

If a chord symbol has "Chord/Rest Duration" in its playback properties,
and the chord symbol has a fret diagram as a parent,
then the results are not defined, but can potentially crash,
as we are casting the parent to a segment when it isn't.
This yields an assertion failure in debug builds,
just randomly bad results in release builds.

Avoiding the crash is simple, I changed parent() to getParentSeg().
I realize, though, that segment duration isn't really the same
as chord/rest duration, since there might be content on other tracks
that results in the segment duration being shorter.
Or, for that matter, another chord symbol on this track.
Eventually we should look at really making this chord/rest duration.
My initial attempt created corruption if there was in fact
another chord symbol on the same track before the end
of the current chord/rest duration.
Fixing this is no doubt possible, and something to consider.
I left a TODO for this.

Resolves: https://musescore.org/en/node/309852

If a chord symbol has "Chord/Rest Duration" in its playback properties,
and the chord symbol has a fret diagram as a parent,
then the results are not defined, but can potentially crash,
as we are casting the parent to a segment when it isn't.
This yields an assertion failure in debug builds,
just randomly bad results in release builds.

Avoiding the crash is simple, I changed parent() to getParentSeg().
I realize, though, that segment duration isn't really the same
as chord/rest duration, since there might be content on other tracks
that results in the segment duration being shorter.
Or, for that matter, another chord symbol on this track.
Eventually we should look at really making this chord/rest duration.
My initial attempt created corruption if there was in fact
another chord symbol on the same track before the end
of the current chord/rest duration.
Fixing this is no doubt possible, and something to consider.
I left a TODO for this.
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.

2 participants