[Bf-blender-cvs] [961bcf9e503] blender-v2.90-release: Fix T80561: Crash when multi-mesh editing UVs with proportional editing

Julian Eisel noreply at git.blender.org
Mon Sep 21 09:50:32 CEST 2020


Commit: 961bcf9e50352558f1af2451ccd09fea4f7c7258
Author: Julian Eisel
Date:   Mon Sep 7 16:14:58 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rB961bcf9e50352558f1af2451ccd09fea4f7c7258

Fix T80561: Crash when multi-mesh editing UVs with proportional editing

Because of a `goto` we would free a variable before it was declared.
Declare it before the `goto` and `NULL`-check the value before freeing.

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

M	source/blender/editors/transform/transform_convert_mesh_uv.c

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

diff --git a/source/blender/editors/transform/transform_convert_mesh_uv.c b/source/blender/editors/transform/transform_convert_mesh_uv.c
index 632769c167e..92447c257da 100644
--- a/source/blender/editors/transform/transform_convert_mesh_uv.c
+++ b/source/blender/editors/transform/transform_convert_mesh_uv.c
@@ -322,6 +322,8 @@ void createTransUVs(bContext *C, TransInfo *t)
       }
     }
 
+    float *prop_dists = NULL;
+
     /* Support other objects using PET to adjust these, unless connected is enabled. */
     if (((is_prop_edit && !is_prop_connected) ? count : countsel) == 0) {
       goto finally;
@@ -349,8 +351,6 @@ void createTransUVs(bContext *C, TransInfo *t)
     td = tc->data;
     td2d = tc->data_2d;
 
-    float *prop_dists = NULL;
-
     if (is_prop_connected) {
       prop_dists = MEM_callocN(em->bm->totloop * sizeof(float), "TransObPropDists(UV Editing)");
 
@@ -397,7 +397,7 @@ void createTransUVs(bContext *C, TransInfo *t)
 
   finally:
     if (is_prop_connected) {
-      MEM_freeN(prop_dists);
+      MEM_SAFE_FREE(prop_dists);
     }
     if (is_island_center) {
       BM_uv_element_map_free(elementmap);



More information about the Bf-blender-cvs mailing list