[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12892] trunk/blender/source/blender/ python/api2_2x/Mesh.c: =Python API bugfix=

Joseph Eagar joeedh at gmail.com
Sat Dec 15 18:41:13 CET 2007


Revision: 12892
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12892
Author:   joeedh
Date:     2007-12-15 18:41:13 +0100 (Sat, 15 Dec 2007)

Log Message:
-----------
=Python API bugfix=
A copy-paste memory access error was causing crashes, especially with the skin 
faces/edge loops script (eh or at least that's where I first noticed the 
crashes)..  An isolated code fragment was accessing memory out-of-bounds.

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/Mesh.c

Modified: trunk/blender/source/blender/python/api2_2x/Mesh.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Mesh.c	2007-12-15 15:30:08 UTC (rev 12891)
+++ trunk/blender/source/blender/python/api2_2x/Mesh.c	2007-12-15 17:41:13 UTC (rev 12892)
@@ -5394,7 +5394,7 @@
 		return EXPP_ReturnPyObjError( PyExc_TypeError,
 				"sequence must contain at least one int or MFace" );
 
-	face_table = (unsigned int *)MEM_callocN( len*sizeof( unsigned int ),
+	face_table = MEM_callocN( len*sizeof( unsigned int ),
 			"face_table" );
 
 	/* get the indices of faces to be removed */
@@ -5517,15 +5517,12 @@
 				++face_count;
 			}
 		}
-
-		/* for each face, deselect each edge */
+		
+		/* for each remaining face, select all edges */
 		tmpface = mesh->mface;
 		fface = (struct fourEdges *)face_edges;
 		for( i = mesh->totface; i--; ++tmpface, ++fface ) {
 			if( tmpface->v1 != UINT_MAX ) {
-				FaceEdges (*face)[4];
-				face = (void *)face_edges;
-				face += face_table[i];
 				fface->v[0]->sel = 1;
 				fface->v[1]->sel = 1;
 				fface->v[2]->sel = 1;
@@ -5533,7 +5530,6 @@
 					fface->v[3]->sel = 1;
 			}
 		}
-
 		/* now mark the selected edges for deletion */
 
 		edge_count = 0;





More information about the Bf-blender-cvs mailing list