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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2014-02-07 16:41:19 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-02-07 16:41:42 +0400
commit52bae9691b08d24c63e5fa43af644bc5654afb11 (patch)
treea6d40376c2707966172938debbf123107a5eee94 /source/blender/modifiers/intern/MOD_skin.c
parent1f5029b18487b411bfe59f6e4359358642dc23a3 (diff)
Fix T38521: skin modifier crash with zero radius vertices.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_skin.c')
-rw-r--r--source/blender/modifiers/intern/MOD_skin.c6
1 files changed, 5 insertions, 1 deletions
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 */