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:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-04-09 06:14:55 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-04-09 06:14:55 +0400
commitb7113002dbea417617e3ef655d42732ade16577e (patch)
tree0d79ad2a8a783482058ae5038c4b9b2b04bc5cf0 /source
parentbcd6c84a66280c5eeed363c91638deeecbcb91f1 (diff)
Fix bug [#30863] Array Modifier Start and End Cap cause crash when the Cap Object has vertex group
Another crash with array caps, was caused by not making a deep enough copy of CD field. Also fixed the type of the 'mask' parameter, was int where it should be 64-bit.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_customdata.h2
-rw-r--r--source/blender/blenkernel/intern/customdata.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index 9797aa1201f..6a3625e2133 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -111,7 +111,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
* then goes through the mesh and makes sure all the customdata blocks are
* consistent with the new layout.*/
void CustomData_bmesh_merge(struct CustomData *source, struct CustomData *dest,
- int mask, int alloctype, struct BMesh *bm, const char htype);
+ CustomDataMask mask, int alloctype, struct BMesh *bm, const char htype);
/* frees data associated with a CustomData object (doesn't free the object
* itself, though)
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index c1d0a1674da..9a879c80b15 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2156,13 +2156,18 @@ void CustomData_bmesh_init_pool(CustomData *data, int totelem, const char htype)
}
void CustomData_bmesh_merge(CustomData *source, CustomData *dest,
- int mask, int alloctype, BMesh *bm, const char htype)
+ CustomDataMask mask, int alloctype, BMesh *bm, const char htype)
{
BMHeader *h;
BMIter iter;
- CustomData destold = *dest;
+ CustomData destold;
void *tmp;
int t;
+
+ /* copy old layer description so that old data can be copied into
+ the new allocation */
+ destold = *dest;
+ if (destold.layers) destold.layers = MEM_dupallocN(destold.layers);
CustomData_merge(source, dest, mask, alloctype, 0);
dest->pool = NULL;
@@ -2208,6 +2213,7 @@ void CustomData_bmesh_merge(CustomData *source, CustomData *dest,
}
if (destold.pool) BLI_mempool_destroy(destold.pool);
+ if (destold.layers) MEM_freeN(destold.layers);
}
void CustomData_bmesh_free_block(CustomData *data, void **block)