diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2021-07-20 14:28:46 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2021-07-20 14:28:46 +0300 |
commit | 9471715720489b36f2472f00363440546e9a07a5 (patch) | |
tree | c8aee2114765dc13ed39a47eb48464ae0de943e2 /source/blender/blenlib/intern/delaunay_2d.cc | |
parent | 75c9788c2753efb75e604d56aea2ed7f3be8b4e4 (diff) |
Fix crash in delaunay C interface test.
The test forgot to set the new need_ids field, which luckily
exposed a bug in the C api for delaunay when that field is false.
Fixed the bug and the test, and added a test for the need_ids false
case.
Diffstat (limited to 'source/blender/blenlib/intern/delaunay_2d.cc')
-rw-r--r-- | source/blender/blenlib/intern/delaunay_2d.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc index 362dbdf15c5..08f18d5cbf3 100644 --- a/source/blender/blenlib/intern/delaunay_2d.cc +++ b/source/blender/blenlib/intern/delaunay_2d.cc @@ -2851,10 +2851,12 @@ extern "C" ::CDT_result *BLI_delaunay_2d_cdt_calc(const ::CDT_input *input, for (int e = 0; e < ne; ++e) { tot_e_orig += res.edge_orig[e].size(); } - for (int f = 0; f < nf; ++f) { + } + for (int f = 0; f < nf; ++f) { + if (input->need_ids) { tot_f_orig += res.face_orig[f].size(); - tot_f_lens += res.face[f].size(); } + tot_f_lens += res.face[f].size(); } output->vert_coords = static_cast<decltype(output->vert_coords)>( |