diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-04-20 03:52:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-04-20 03:52:14 +0400 |
commit | fde9ecbfbd40b321cc5d0779d4bb5690419aaaea (patch) | |
tree | e0a5887f05f03ba86567be279fa666420d116759 /source/blender/blenkernel/intern | |
parent | be1746694217efa4bbf7121d92f84db74d9e419d (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.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/idprop.c | 7 |
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, |