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:
authorCampbell Barton <ideasman42@gmail.com>2011-04-20 03:52:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-04-20 03:52:14 +0400
commitfde9ecbfbd40b321cc5d0779d4bb5690419aaaea (patch)
treee0a5887f05f03ba86567be279fa666420d116759
parentbe1746694217efa4bbf7121d92f84db74d9e419d (diff)
fix [#26967] separate mesh with p crashes blender
copying ID properties assumed each property was allocated separately which isnt the case for IDP_Arrays.
-rw-r--r--source/blender/blenkernel/intern/idprop.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 67be3e71101..80962de9730 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -78,9 +78,12 @@ IDProperty *IDP_NewIDPArray(const char *name)
IDProperty *IDP_CopyIDPArray(IDProperty *array)
{
- IDProperty *narray = MEM_dupallocN(array), *tmp;
+ /* dont use MEM_dupallocN because this may be part of an array */
+ IDProperty *narray = MEM_mallocN(sizeof(IDProperty), "IDP_CopyIDPArray"), *tmp;
int i;
-
+
+ *narray= *array;
+
narray->data.pointer = MEM_dupallocN(array->data.pointer);
for (i=0; i<narray->len; i++) {
/*ok, the copy functions always allocate a new structure,