[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43659] trunk/blender/source/blender/ modifiers/intern/MOD_boolean_util.c: Fix #29965: Crash: Memory psys node array: end corrupt

Sergey Sharybin sergey.vfx at gmail.com
Tue Jan 24 09:43:33 CET 2012


Revision: 43659
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43659
Author:   nazgul
Date:     2012-01-24 08:43:17 +0000 (Tue, 24 Jan 2012)
Log Message:
-----------
Fix #29965: Crash: Memory psys node array: end corrupt

Original indices from right operand were used in boolean result derived mesh
which lead to crash if right operand has got more entities (faces/edges/vertices)
than left operand.

Modified Paths:
--------------
    trunk/blender/source/blender/modifiers/intern/MOD_boolean_util.c

Modified: trunk/blender/source/blender/modifiers/intern/MOD_boolean_util.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_boolean_util.c	2012-01-24 01:56:44 UTC (rev 43658)
+++ trunk/blender/source/blender/modifiers/intern/MOD_boolean_util.c	2012-01-24 08:43:17 UTC (rev 43659)
@@ -350,7 +350,7 @@
 	GHash *material_hash = NULL;
 	Mesh *me1= (Mesh*)ob1->data;
 	Mesh *me2= (Mesh*)ob2->data;
-	int i;
+	int i, *origindex_layer;
 
 	// create a new DerivedMesh
 	result = CDDM_new(vertex_it->num_elements, 0, face_it->num_elements);
@@ -379,6 +379,8 @@
 		*totmat = 0;
 	}
 
+	origindex_layer = result->getFaceDataArray(result, CD_ORIGINDEX);
+
 	// step through the face iterators
 	for(i = 0; !face_it->Done(face_it->it); i++) {
 		Mesh *orig_me;
@@ -427,6 +429,9 @@
 					  (orig_me == me2)? mapmat: NULL);
 
 		test_index_face(mface, &result->faceData, i, csgface.vertex_number);
+
+		if(origindex_layer && orig_ob == ob2)
+			origindex_layer[i] = ORIGINDEX_NONE;
 	}
 
 	if (material_hash)



More information about the Bf-blender-cvs mailing list