code cleanup: var rename and add assert, when writing to out of bounds array.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 29 Jan 2013 00:20:04 +0000 (00:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 29 Jan 2013 00:20:04 +0000 (00:20 +0000)
minor edit to recent tip change.

source/blender/editors/screen/screendump.c
source/blender/editors/transform/transform.c

index 090fad5..efd0db3 100644 (file)
@@ -272,7 +272,7 @@ void SCREEN_OT_screenshot(wmOperatorType *ot)
        
        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 @@ void SCREEN_OT_screencast(wmOperatorType *ot)
        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");
 }
index ac43143..de73c6f 100644 (file)
@@ -4991,7 +4991,7 @@ static int createEdgeSlideVerts(TransInfo *t)
        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 @@ static int createEdgeSlideVerts(TransInfo *t)
        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 @@ static int createEdgeSlideVerts(TransInfo *t)
                if (!v->e)
                        continue;
                
-               first = v;
+               v_first = v;
 
                /*walk along the edge loop*/
                e = v->e;
@@ -5132,7 +5133,7 @@ static int createEdgeSlideVerts(TransInfo *t)
                                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 @@ static int createEdgeSlideVerts(TransInfo *t)
                }
 
                /*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 @@ static int createEdgeSlideVerts(TransInfo *t)
                        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 @@ static int createEdgeSlideVerts(TransInfo *t)
 
                        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++;
        }