[Bf-blender-cvs] [fb463a13cdc] temp_bmesh_multires: Sculpt dyntopo: Fix memory corruption caused by improperly disabled code.

Joseph Eagar noreply at git.blender.org
Mon Aug 16 11:12:50 CEST 2021


Commit: fb463a13cdc6ac825b9717931abc066ce317d5d5
Author: Joseph Eagar
Date:   Mon Aug 16 02:12:30 2021 -0700
Branches: temp_bmesh_multires
https://developer.blender.org/rBfb463a13cdc6ac825b9717931abc066ce317d5d5

Sculpt dyntopo: Fix memory corruption caused by improperly disabled
code.

===================================================================

M	source/blender/editors/sculpt_paint/sculpt_boundary.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/sculpt_boundary.c b/source/blender/editors/sculpt_paint/sculpt_boundary.c
index 9efc4dece8e..3c1766dea86 100644
--- a/source/blender/editors/sculpt_paint/sculpt_boundary.c
+++ b/source/blender/editors/sculpt_paint/sculpt_boundary.c
@@ -322,19 +322,20 @@ static float *calc_boundary_tangent(SculptSession *ss, SculptBoundary *boundary)
     zero_v3(dir);
 
     SculptVertexNeighborIter ni;
-    int val = SCULPT_vertex_valence_get(ss, vertex);
-    float *ws = BLI_array_alloca(ws, val);
-    float *cot1 = BLI_array_alloca(ws, val);
-    float *cot2 = BLI_array_alloca(ws, val);
-    float *areas = BLI_array_alloca(ws, val);
-    float totarea;
-
-    SCULPT_get_cotangents(ss, vertex, ws, cot1, cot2, areas, &totarea);
 
     float no1[3];
     SCULPT_vertex_normal_get(ss, vertex, no1);
 
 #if 0
+    volatile int val = SCULPT_vertex_valence_get(ss, vertex);
+    float *ws = BLI_array_alloca(ws, val);
+    float *cot1 = BLI_array_alloca(cot1, val);
+    float *cot2 = BLI_array_alloca(cot2, val);
+    float *areas = BLI_array_alloca(areas, val);
+    float totarea;
+
+    SCULPT_get_cotangents(ss, vertex, ws, cot1, cot2, areas, &totarea);
+
     float(*cos)[3] = BLI_array_alloca(cos, val);
     float *scalars = BLI_array_alloca(scalars, val);



More information about the Bf-blender-cvs mailing list