[Bf-blender-cvs] [52bae96] master: Fix T38521: skin modifier crash with zero radius vertices.

Brecht Van Lommel noreply at git.blender.org
Fri Feb 7 15:10:37 CET 2014


Commit: 52bae9691b08d24c63e5fa43af644bc5654afb11
Author: Brecht Van Lommel
Date:   Fri Feb 7 13:41:19 2014 +0100
https://developer.blender.org/rB52bae9691b08d24c63e5fa43af644bc5654afb11

Fix T38521: skin modifier crash with zero radius vertices.

===================================================================

M	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 b5c0ae8..ca25d78 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 */




More information about the Bf-blender-cvs mailing list