Fix potential infinite loop in TempoCurve::set_position()

- it was previously possible for frame_step to be zero for tempo sections with
	  a short duration, resulting in endlessly adding 0 to current_frame.
This commit is contained in:
nick_m 2016-07-11 03:53:36 +10:00
parent 5156b8aeb5
commit b8a7ee001b

View File

@ -128,7 +128,7 @@ TempoCurve::set_position (framepos_t frame, framepos_t end_frame)
points->push_back (ArdourCanvas::Duple (ArdourCanvas::COORD_MAX - 5.0, y_pos));
} else {
const framepos_t frame_step = (end_frame - frame) / 5;
const framepos_t frame_step = max ((end_frame - frame) / 5, (framepos_t) 1);
framepos_t current_frame = frame;
while (current_frame < (end_frame - frame_step)) {