Crash on mouse press on tabulature in Repitch input mode
Steps to reproduce:
1. Create a score with a treble clef and a tabulature.
2. Add any note to the treble clef.
3. Enter Re-pitch input mode, ensure that note input mode is turned on.
4. Repitch the added note (e.g. press A)
5. Move mouse to the tabulature.
6. Click mouse.
Result: crash
Attachment | Size |
---|---|
tab_crash.png | 148.89 KB |
Comments
This happens in 2.3.2 also, and steps 2 and 4 are not even necessary to produce the crash. Repitch input mode was never implemented (and never intended?) for TAB staves, and when the input cursor is on a TAB staff, this condition will always be false, even when "Re-Pitch" mode is selected. But it will be true if "Re-Pitch" mode is selected and the input cursor is on a standard staff. This leads to the possibility of calling Score::repitchNote() with a
Position p
that refers to a position on a TAB staff. The problem with that is thatabsStep(p.line, clef)
does not return a meaningful result whenclef
is any of these values, which will lead to a crash when calculating the TPCs.I see two options:
1. Modify this condition to require that
Position p
not refer to a position on a TAB staff, or2. Implement Repitch mode for TAB staves.
Option 1 is very easy to do. In fact, I could submit a patch right now. Is option 2 even something we want to consider?
See https://github.com/musescore/MuseScore/pull/4012. This fixes the issue by taking option 1.
I never saw requests for option 2, so let's keep the fix for now.
Fixed in branch master, commit dbae4d0e62
fix #276670: Crash on mouse press on tablature in Re-Pitch input mode
Fixed in branch master, commit cfe6dcc508
Merge pull request #4012 from mattmcclinch/276670-repitch-tab-crash
fix #276670: Crash on mouse press on tablature in Re-Pitch input mode
Automatically closed -- issue fixed for 2 weeks with no activity.