[Bf-blender-cvs] [deb3999] master: Fix T40776: Crash when using empty curve as a deformation target

Sergey Sharybin noreply at git.blender.org
Wed Jun 25 12:26:28 CEST 2014


Commit: deb3999696cbcbe19ace96f334477a985e835060
Author: Sergey Sharybin
Date:   Wed Jun 25 16:25:43 2014 +0600
https://developer.blender.org/rBdeb3999696cbcbe19ace96f334477a985e835060

Fix T40776: Crash when using empty curve as a deformation target

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

M	source/blender/blenkernel/intern/lattice.c

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

diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 7b91945..ea55f32 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -626,16 +626,19 @@ static bool calc_curve_deform(Scene *scene, Object *par, float co[3],
 	short index;
 	const bool is_neg_axis = (axis > 2);
 
-	/* to be sure, mostly after file load */
-	if (ELEM(NULL, par->curve_cache, par->curve_cache->path)) {
+	/* to be sure, mostly after file load, also cyclic dependencies */
 #ifdef CYCLIC_DEPENDENCY_WORKAROUND
+	if (par->curve_cache == NULL) {
 		BKE_displist_make_curveTypes(scene, par, false);
+	}
 #endif
-		if (par->curve_cache->path == NULL) {
-			return 0;  // happens on append and cyclic dependencies...
-		}
+
+	if (par->curve_cache->path == NULL) {
+		return 0;  /* happens on append, cyclic dependencies
+		            * and empty curves
+		            */
 	}
-	
+
 	/* options */
 	if (is_neg_axis) {
 		index = axis - 3;




More information about the Bf-blender-cvs mailing list