[trunk] Another crash on time signature change

• Apr 27, 2011 - 10:48
Type
Functional
Severity
S2 - Critical
Status
closed
Project

This is similar to the crashing on time signature change issue and to the [Trunk] Crash on changing time signature issue, but not the same.

This issue appeared after the recent changes to time signature properties and happens only if the old and the new time signature fractions evaluate to different values (i.e. changing 4/4 to 2/2 is fine (4/4 = 2/2 = 1), changing 4/4 to 3/4 is not; I hope this explanation makes sense).

Steps:

1) Create a score in 4/4, a few measures are enough
2) Drop a 3/4 time signature in any measure after the first

Result: crash

Notes:

1) Crash happens in function Score::cmdAddTimeSig(), file edit.cpp, line 707: if there is not a time signature already at that segment, var ots is 0 and the programme crashes.

2) The attached patch corrects the issue by adding a test on ots in line 707.

3) Of course, I have tested the patch in a few cases and I am using it locally without problems. However, as the meaning of the several local vars of that function is not obvious at first sight, it is better if the author of the code (Werner?) revises the change before committing.

4) I have no idea if this patch corrects also the other issues quoted above, but I doubt, as I have never been able to replicate them.

Thanks,

M.

Attachment Size
trunk_edit_cpp_droptimesigcrash.patch 498 bytes

Comments