[Bf-blender-cvs] [de6258c6186] temp_bmesh_multires: Silly me, don't use alloca in this situation

Joseph Eagar noreply at git.blender.org
Sun Aug 22 22:16:30 CEST 2021


Commit: de6258c61866988c89930fa1552d8508fe5c2c0c
Author: Joseph Eagar
Date:   Sun Aug 22 13:16:10 2021 -0700
Branches: temp_bmesh_multires
https://developer.blender.org/rBde6258c61866988c89930fa1552d8508fe5c2c0c

Silly me, don't use alloca in this situation

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

M	source/blender/bmesh/intern/bmesh_mesh.c

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

diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index cc99aed4b17..901149907b4 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -908,7 +908,7 @@ void BM_mesh_remap(BMesh *bm,
 
   for (int i = 0; i < 4; i++) {
     if (cdatas[i]->totsize) {
-      swap_temps[i] = alloca(cdatas[i]->totsize);
+      swap_temps[i] = MEM_mallocN(cdatas[i]->totsize, "cdata temp");
     }
     else {
       swap_temps[i] = NULL;
@@ -1336,6 +1336,10 @@ void BM_mesh_remap(BMesh *bm,
       }
     }
   }
+
+  for (int i = 0; i < 4; i++) {
+    MEM_SAFE_FREE(swap_temps[i]);
+  }
 }
 
 /**



More information about the Bf-blender-cvs mailing list