Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-09-07 17:14:58 +0300
committerJulian Eisel <julian@blender.org>2020-09-07 17:17:07 +0300
commit9681708c1cf12026095b3a8a52cd0b3fa046ba1f (patch)
treedfa509f5932be80f3edec86e2d5c185e7569ca6b /source
parentd71458d91963b56a02bc05d617344fd2871951dd (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/transform/transform_convert_mesh_uv.c6
1 files changed, 3 insertions, 3 deletions
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);