Crash on set as style operation if score ends with a frame
I can reproduce this on Linux in 3.3 and in current master.
1) load attached score
2) position the view so the text in the frame at the end of the score is not in view
3) select the text on the first measure
4) press "Set as style" on the offset in Inspector
Result: crash. For some reason we are trying to position the viewport to that text, not sure why, apparently moveViewPortToLastEdit() is not understanding the actual relevant element is the staff text on the first measure. The crash itself happens in adjustCanvasPosition(), we've passed in the text as the element and staff is 0. Easy fix for crash would be to handle a null staff within adjustCanvasPosition() I guess, but really, we shouldn't be trying to position the viewport to that last text in the first place. I'lve got a little time to investigate right now but then I have to go teach this evening, so I'm not necessarily expecting to have a PR.
Attachment | Size |
---|---|
set-as-style-crash.mscz | 4 KB |
Comments
See https://github.com/musescore/MuseScore/pull/5510
Fixed in branch master, commit a96b72c2fe
_fix #298061: fix a crash on "set as style" if score ends with a frame
adjust viewport to a frame. This avoids a crash itself.
to the current edit operation in CmdState. This avoids trying to
unnecessarily jump to the frame at the end of a score._
Fixed in branch master, commit c7ab61ec08
_Merge pull request #5510 from dmitrio95/298061-set-as-style-viewport-crash
fix #298061: fix a crash on "set as style" if score ends with a frame_
Fixed in branch 3.3.4, commit 7684abeccf
_fix #298061: fix a crash on "set as style" if score ends with a frame
adjust viewport to a frame. This avoids a crash itself.
to the current edit operation in CmdState. This avoids trying to
unnecessarily jump to the frame at the end of a score._
Automatically closed -- issue fixed for 2 weeks with no activity.