musescore/MuseScore — pull request #18 by txv (2012-07-19 09:27:34+00:00)
Title: Crash Fix - Rests at End of Score

If you hit rest (0) until you reach the end of the score, and then hit left or right arrow, it causes a segmentation fault, because filling up the final chordrest with a rest puts the cursor out of bounds.

This crash is present in trunk in Debian stable, and on 1.2 in Debian Stable, Ubuntu 12.04, and Windows 7, and on 1.1 in Windows 7.

This commit adds a check to the end of Score::cmdEnterRest in edit.cpp to see if it's about to go out of bounds. If so, it reuses methodology from "select-end-score" and "prev-measure" to keep your cursor safely within bounds at the end of the score.