diff options
author | Joshua Leung <aligorith@gmail.com> | 2017-01-21 16:54:35 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2017-01-21 16:55:10 +0300 |
commit | d2382f782e74f9e7b4df49ffc8e40dabb0b8af50 (patch) | |
tree | 7db87d5722b351d34c88aa7fd5934abd709fefa8 /source/blender/editors/space_view3d/drawarmature.c | |
parent | 82187a58f53fef8fe88f89a8aa38729d871a2a37 (diff) |
Fix T49527: Blender stalls when changing armature ghosting range with stepsize = 0
A big thanks to Steffen Mortensen (stifan) for finding the root cause of this bug!
Diffstat (limited to 'source/blender/editors/space_view3d/drawarmature.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 95a2df68e4a..149144d969a 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -2463,6 +2463,10 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base if (end <= start) return; + /* prevent infinite loops if this is set to 0 - T49527 */ + if (arm->ghostsize < 1) + arm->ghostsize = 1; + stepsize = (float)(arm->ghostsize); range = (float)(end - start); @@ -2608,7 +2612,11 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base) calc_action_range(adt->action, &start, &end, 0); if (start == end) return; - + + /* prevent infinite loops if this is set to 0 - T49527 */ + if (arm->ghostsize < 1) + arm->ghostsize = 1; + stepsize = (float)(arm->ghostsize); range = (float)(arm->ghostep) * stepsize + 0.5f; /* plus half to make the for loop end correct */ |