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
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-01-28 23:46:05 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-01-28 23:49:23 +0300
commit147e22ef700124dcbaa5576b72a2a77e73adf350 (patch)
tree4b5b127911fd0be34de5c3732a7b3709cf14d6d1 /source/blender/modifiers/intern/MOD_solidify.c
parentcad1016c20b529c394af6ac22e88c99dad41c20c (diff)
Fix T60840: Serious memleak in solidify modifier.
Another one painful to pin down, due to misleading info in report, and more than anything else, waaayyyyy too complex example file!
Diffstat (limited to 'source/blender/modifiers/intern/MOD_solidify.c')
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 6283b7a250d..d43e843f9d5 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -379,7 +379,10 @@ static Mesh *applyModifier(
CustomData_copy_data(&mesh->edata, &result->edata, 0, (int)numEdges, (int)numEdges);
CustomData_copy_data(&mesh->ldata, &result->ldata, 0, 0, (int)numLoops);
- CustomData_copy_data(&mesh->ldata, &result->ldata, 0, (int)numLoops, (int)numLoops);
+ /* DO NOT copy here the 'copied' part of loop data, we want to reverse loops
+ * (so that winding of copied face get reversed, so that normals get reversed
+ * and point in expected direction...).
+ * If we also copy data here, then this data get overwritten (and allocated memory becomes memleak). */
CustomData_copy_data(&mesh->pdata, &result->pdata, 0, 0, (int)numFaces);
CustomData_copy_data(&mesh->pdata, &result->pdata, 0, (int)numFaces, (int)numFaces);