diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-18 14:22:56 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-18 14:22:56 +0400 |
commit | c05af6210e557f3868d3769d1a633d1bbbd63e54 (patch) | |
tree | 205a7338e834eaaad61e9d762299f138fafb4a6d /source/blender/blenkernel | |
parent | 997850aeccb1f2c9f83c592ca41793908e050202 (diff) |
Fixed crash of self-intersection loop in special cases
It was wrongly calculated bucket number per side in cases when some
of segments is filling the whole bounding box across some of dimension.
Solved by limiting buckets at least to 1 in such cases.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/mask.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index 027d5ba4826..77b404e627a 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -564,6 +564,13 @@ static void spline_feather_collapse_inner_loops(float (*feather_points)[2], int max_delta = MAX2(max_delta_x, max_delta_y); buckets_per_side = MIN2(512, 0.9f / max_delta); + + if (buckets_per_side == 0) { + /* happens when some segment fills the whole bounding box across some of dimension */ + + buckets_per_side = 1; + } + tot_bucket = buckets_per_side * buckets_per_side; bucket_size = 1.0f / buckets_per_side; |