[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54161] trunk/blender/source/blender/ editors: code cleanup: var rename and add assert, when writing to out of bounds array.

Campbell Barton ideasman42 at gmail.com
Tue Jan 29 01:20:09 CET 2013


Revision: 54161
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54161
Author:   campbellbarton
Date:     2013-01-29 00:20:04 +0000 (Tue, 29 Jan 2013)
Log Message:
-----------
code cleanup: var rename and add assert, when writing to out of bounds array.
minor edit to recent tip change.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/screen/screendump.c
    trunk/blender/source/blender/editors/transform/transform.c

Modified: trunk/blender/source/blender/editors/screen/screendump.c
===================================================================
--- trunk/blender/source/blender/editors/screen/screendump.c	2013-01-28 23:58:09 UTC (rev 54160)
+++ trunk/blender/source/blender/editors/screen/screendump.c	2013-01-29 00:20:04 UTC (rev 54161)
@@ -272,7 +272,7 @@
 	
 	WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE, FILE_SPECIAL, FILE_SAVE,
 	                               WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
-	RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "Capture the whole window. If disabled, only capture the active area");
+	RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "Capture the whole window. Otherwise only capture the active area");
 }
 
 /* *************** screenshot movie job ************************* */
@@ -500,5 +500,5 @@
 	ot->flag = 0;
 	
 	RNA_def_property(ot->srna, "filepath", PROP_STRING, PROP_FILEPATH);
-	RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "Capture the whole window. If disabled, only capture the active area");
+	RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "Capture the whole window. Otherwise only capture the active area");
 }

Modified: trunk/blender/source/blender/editors/transform/transform.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform.c	2013-01-28 23:58:09 UTC (rev 54160)
+++ trunk/blender/source/blender/editors/transform/transform.c	2013-01-29 00:20:04 UTC (rev 54161)
@@ -4991,7 +4991,7 @@
 	BMesh *bm = em->bm;
 	BMIter iter;
 	BMEdge *e, *e1;
-	BMVert *v, *v2, *first;
+	BMVert *v, *v2;
 	TransDataEdgeSlideVert *sv_array;
 	BMBVHTree *btree;
 	SmallHash table;
@@ -5098,6 +5098,7 @@
 	j = 0;
 	while (1) {
 		BMLoop *l, *l1, *l2;
+		BMVert *v_first;
 
 		v = NULL;
 		BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
@@ -5112,7 +5113,7 @@
 		if (!v->e)
 			continue;
 		
-		first = v;
+		v_first = v;
 
 		/*walk along the edge loop*/
 		e = v->e;
@@ -5132,7 +5133,7 @@
 				break;
 
 			v = BM_edge_other_vert(e, v);
-		} while (e != first->e);
+		} while (e != v_first->e);
 
 		BM_elem_flag_disable(v, BM_ELEM_TAG);
 
@@ -5152,10 +5153,12 @@
 		}
 
 		/*iterate over the loop*/
-		first = v;
+		v_first = v;
 		do {
 			TransDataEdgeSlideVert *sv = sv_array + j;
 
+			BLI_assert(j < MEM_allocN_len(sv_array) / sizeof(*sv));
+
 			sv->v = v;
 			sv->origvert = *v;
 			sv->loop_nr = loop_nr;
@@ -5179,6 +5182,8 @@
 			if (!e) {
 				//v2=v, v = BM_edge_other_vert(l1->e, v);
 
+				BLI_assert(j + 1 < MEM_allocN_len(sv_array) / sizeof(*sv));
+
 				sv = sv_array + j + 1;
 				sv->v = v;
 				sv->origvert = *v;
@@ -5208,7 +5213,7 @@
 
 			BM_elem_flag_disable(v, BM_ELEM_TAG);
 			BM_elem_flag_disable(v2, BM_ELEM_TAG);
-		} while (e != first->e && l1);
+		} while (e != v_first->e && l1);
 
 		loop_nr++;
 	}




More information about the Bf-blender-cvs mailing list