Fix crash scrubbing in the animation player with 1 frame loaded
Regression in caused an integer division by zero.
[0]: e6933e526c
This commit is contained in:
@@ -1066,7 +1066,7 @@ static void playanim_change_frame(PlayState *ps)
|
||||
playanim_window_get_size(ps->ghost_data.window, &sizex, &sizey);
|
||||
const int i_last = static_cast<PlayAnimPict *>(ps->picsbase.last)->frame;
|
||||
/* Without this the frame-indicator location isn't closest to the cursor. */
|
||||
const int correct_rounding = (sizex / i_last) / 2;
|
||||
const int correct_rounding = (sizex / (i_last + 1)) / 2;
|
||||
const int i = clamp_i((i_last * (ps->frame_cursor_x + correct_rounding)) / sizex, 0, i_last);
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
|
||||
Reference in New Issue
Block a user