diff options
author | Joshua Leung <aligorith@gmail.com> | 2012-10-05 10:40:21 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2012-10-05 10:40:21 +0400 |
commit | 3986a5f83a5c101b57cfdaeb456afedd371c5463 (patch) | |
tree | f7e5bbece82f1b3b24f6bac439481d7f4410b3a7 /source/blender | |
parent | a92171c21306bfe22b36573737e04defe433d611 (diff) |
Bugfix [#32760] Crash on entering pose mode if motion paths have no baked points
Dunno how a file with this situation arose, but we now perform some more sanity checking to abort in this sticky situation.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_view3d/drawanimviz.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index 5f312ff7fca..135e9b891bb 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -107,11 +107,6 @@ void draw_motion_path_instance(Scene *scene, * - abort if whole range is past ends of path * - otherwise clamp endpoints to extents of path */ - if ((sfra > mpath->end_frame) || (efra < mpath->start_frame)) { - /* whole path is out of bounds */ - return; - } - if (sfra < mpath->start_frame) { /* start clamp */ sfra = mpath->start_frame; @@ -121,9 +116,14 @@ void draw_motion_path_instance(Scene *scene, efra = mpath->end_frame; } + if ((sfra > mpath->end_frame) || (efra < mpath->start_frame)) { + /* whole path is out of bounds */ + return; + } + len = efra - sfra; - if (len <= 0) { + if ((len <= 0) || (mpath->points == NULL)) { return; } @@ -180,7 +180,7 @@ void draw_motion_path_instance(Scene *scene, UI_ThemeColorBlendShade(TH_CFRAME, TH_BACK, intensity, 10); } - /* draw a vertex with this color */ + /* draw a vertex with this color */ glVertex3fv(mpv->co); } @@ -230,7 +230,7 @@ void draw_motion_path_instance(Scene *scene, unsigned char col[4]; UI_GetThemeColor3ubv(TH_TEXT_HI, col); col[3] = 255; - + for (i = 0, mpv = mpv_start; i < len; i += stepsize, mpv += stepsize) { char numstr[32]; float co[3]; |