diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-12-14 13:47:05 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-12-14 13:47:05 +0400 |
commit | edabf35affb2daf07ff806bf1c0988d4ad6406cd (patch) | |
tree | 888b0fd32bac8dfe32a2847e5478265aa4540930 | |
parent | d38881706cdd3e52e130ccf400a609caafc3a84a (diff) |
Fix #33530: Blender Crash when selecting "Point select mode" in Particle Mode with and 0 hairs object
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 780b7426d51..6c58ca5a691 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -4657,9 +4657,11 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit) if (!(point->flag & PEP_HIDE)) totkeys += point->totkey; - if (edit->points && !(edit->points->keys->flag & PEK_USE_WCO)) - pd = pdata = MEM_callocN(totkeys * 3 * sizeof(float), "particle edit point data"); - cd = cdata = MEM_callocN(totkeys * (timed ? 4 : 3) * sizeof(float), "particle edit color data"); + if (totkeys) { + if (edit->points && !(edit->points->keys->flag & PEK_USE_WCO)) + pd = pdata = MEM_callocN(totkeys * 3 * sizeof(float), "particle edit point data"); + cd = cdata = MEM_callocN(totkeys * (timed ? 4 : 3) * sizeof(float), "particle edit color data"); + } for (i = 0, point = edit->points; i < totpoint; i++, point++) { if (point->flag & PEP_HIDE) |