[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33417] trunk/blender/source/blender/ modifiers/intern/MOD_array.c: Bugfix #24999

Ton Roosendaal ton at blender.org
Wed Dec 1 18:47:38 CET 2010


Revision: 33417
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33417
Author:   ton
Date:     2010-12-01 18:47:38 +0100 (Wed, 01 Dec 2010)

Log Message:
-----------
Bugfix #24999

Array Modifier: edge indices could be equal to numVerts, causing 
bad crashes in derivedmesh. Similar fix to previous here with
face indices. Should poke the coder of this... for now it survives OK.

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

Modified: trunk/blender/source/blender/modifiers/intern/MOD_array.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_array.c	2010-12-01 15:58:45 UTC (rev 33416)
+++ trunk/blender/source/blender/modifiers/intern/MOD_array.c	2010-12-01 17:47:38 UTC (rev 33417)
@@ -443,7 +443,13 @@
 			  }
 
 			  if(med.v1 == med.v2) continue;
-
+			  
+			  /* XXX Unfortunately the calc_mapping returns sometimes numVerts... leads to bad crashes */
+			  if(med.v1 >= numVerts)
+				  med.v1= numVerts-1;
+			  if(med.v2 >= numVerts)
+				  med.v2= numVerts-1;
+			  
 			  if (initFlags) {
 				  med.flag |= ME_EDGEDRAW | ME_EDGERENDER;
 			  }
@@ -460,9 +466,15 @@
 			  {
 				  vert1 = calc_mapping(indexMap, inMED.v1, j);
 				  vert2 = calc_mapping(indexMap, inMED.v2, j);
-
+				  
 				  /* edge could collapse to single point after mapping */
 				  if(vert1 == vert2) continue;
+				  
+				  /* XXX Unfortunately the calc_mapping returns sometimes numVerts... leads to bad crashes */
+				  if(vert1 >= numVerts)
+					  vert1= numVerts-1;
+				  if(vert2 >= numVerts)
+					  vert2= numVerts-1;
 
 				  /* avoid duplicate edges */
 				  if(!BLI_edgehash_haskey(edges, vert1, vert2)) {





More information about the Bf-blender-cvs mailing list