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:
authorAntony Riakiotakis <kalast@gmail.com>2014-03-07 18:58:56 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-03-07 18:58:56 +0400
commitf03df4f0241328c1d65e6910a5374935a6f2f78d (patch)
tree4036b214febb83a120dbde4ff0f3a42f7a6baf88 /source/blender/blenkernel/intern/pbvh.c
parent20f7a34abe871a6c3e4b168c6831bbaef55ce64f (diff)
Fix crash when changing and using between layer and other brushes in
dyntopo Layer brush would not invalidate the layer_disp arrays in dyntopo mode, checking only for the existence of the array. This means that if a tool resized the node due to topology changes, the layer brush code could index (and write!) out of bounds in the array. Solution is to invalidate the layer data prior to each stroke in dyntopo.
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh.c')
-rw-r--r--source/blender/blenkernel/intern/pbvh.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index cb7c7c636c8..426a1e1646c 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -626,6 +626,13 @@ void BKE_pbvh_free(PBVH *bvh)
MEM_freeN(bvh);
}
+void BKE_pbvh_free_layer_disp(PBVH *bvh)
+{
+ int i;
+ for (i = 0; i < bvh->totnode; ++i)
+ BKE_pbvh_node_layer_disp_free(&bvh->nodes[i]);
+}
+
static void pbvh_iter_begin(PBVHIter *iter, PBVH *bvh, BKE_pbvh_SearchCallback scb, void *search_data)
{
iter->bvh = bvh;