Crash on mouse press on tabulature in Repitch input mode

• Sep 28, 2018 - 13:03
Reported version
3.0
Type
Functional
Severity
S2 - Critical
Status
closed
Project

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 that absStep(p.line, clef) does not return a meaningful result when clef 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, or
2. 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?