Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-06-20 21:50:59 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-20 21:50:59 +0400
commitc849a938a0585b473ecc3d28407f918ddd25df08 (patch)
treee9d918b5452016197cdbcf511d3d2890cf01df2e /source/blender
parent203e02f9d78dc88df42221b88d86a440ce6b70b4 (diff)
fix for crash drawing zero length motion path and a leak with zero length paths.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/anim.c7
-rw-r--r--source/blender/editors/space_view3d/drawanimviz.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 1763866c000..0747d87a0ab 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -171,7 +171,12 @@ bMotionPath *animviz_verify_motionpaths(Scene *scene, Object *ob, bPoseChannel *
avs= &ob->avs;
dst= &ob->mpath;
}
-
+
+ /* avoid 0 size allocs */
+ if(avs->path_sf >= avs->path_ef) {
+ return NULL;
+ }
+
/* if there is already a motionpath, just return that,
* but provided it's settings are ok
*/
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c
index ee78fd92b79..aa3ba1a3062 100644
--- a/source/blender/editors/space_view3d/drawanimviz.c
+++ b/source/blender/editors/space_view3d/drawanimviz.c
@@ -117,7 +117,11 @@ void draw_motion_path_instance(Scene *scene,
len = mpath->length;
mpv_start= mpath->points;
}
-
+
+ if(len <= 0) {
+ return;
+ }
+
/* draw curve-line of path */
glShadeModel(GL_SMOOTH);