Fix #122538: crash calling curves_copy_point_selection with empty selection

This is accessing curve offsets, which don't have entries for empty
geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/122499
This commit is contained in:
Lukas Tönne 2024-05-31 16:24:35 +02:00 committed by Falk David
parent 28cef56ad2
commit b588daa68b

@ -1209,6 +1209,9 @@ CurvesGeometry curves_copy_point_selection(
threading::parallel_invoke(
dst_curves.curves_num() > 1024,
[&]() {
if (curves_to_copy.is_empty()) {
return;
}
MutableSpan<int> new_curve_offsets = dst_curves.offsets_for_write();
array_utils::gather(
curve_point_counts.as_span(), curves_to_copy, new_curve_offsets.drop_back(1));