From 52bae9691b08d24c63e5fa43af644bc5654afb11 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 7 Feb 2014 13:41:19 +0100 Subject: Fix T38521: skin modifier crash with zero radius vertices. --- source/blender/modifiers/intern/MOD_skin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/modifiers/intern/MOD_skin.c') diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index b5c0ae8b93f..ca25d785da9 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -774,7 +774,11 @@ static int calc_edge_subdivisions(const MVert *mvert, const MVertSkin *nodes, avg[0] = half_v2(evs[0]->radius); avg[1] = half_v2(evs[1]->radius); - num_subdivisions = (int)((float)edge_len / (avg[0] + avg[1])); + + if (avg[0] + avg[1] == 0.0f) + num_subdivisions = 0; + else + num_subdivisions = (int)((float)edge_len / (avg[0] + avg[1])); /* If both ends are branch nodes, two intermediate nodes are * required */ -- cgit v1.2.3