From 3986a5f83a5c101b57cfdaeb456afedd371c5463 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 5 Oct 2012 06:40:21 +0000 Subject: [PATCH] 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. --- .../blender/editors/space_view3d/drawanimviz.c | 16 ++++++++-------- 1 file 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];