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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-03-20 13:22:47 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-03-20 13:22:47 +0300
commit46a391b668c19ea3053d117dea67386b13904f78 (patch)
tree4041015a73a02c4be349680a9279395daf95d9e9 /source/blender/blenkernel/intern
parent8e5c407fc446b35042c626e7d60ff9a2336093f4 (diff)
Fix missing array duplication when copying material
Texture paint slots were copied as a pointer, causing double-free.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/material.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 0dd7047a376..01f16625386 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -256,6 +256,10 @@ void BKE_material_copy_data(Main *bmain, Material *ma_dst, const Material *ma_sr
ma_dst->preview = NULL;
}
+ if (ma_src->texpaintslot != NULL) {
+ ma_dst->texpaintslot = MEM_dupallocN(ma_src->texpaintslot);
+ }
+
BLI_listbase_clear(&ma_dst->gpumaterial);
}