From 72fd267024fe0a4963a91b2e6bdf415a2bca8cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= Date: Mon, 11 Nov 2024 14:25:08 +0100 Subject: [PATCH] Fix #130110: Fill tool crashes when extension lines are enabled This was caused by ba28469e, which subtracted the start of the offsets array, so it can't be used for "max array size" any more. Use the "last()" entry directly to correctly size the view positions array. Pull Request: https://projects.blender.org/blender/blender/pulls/130127 --- source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc b/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc index 3d868cf0699..e409c4172fc 100644 --- a/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc +++ b/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc @@ -712,7 +712,7 @@ static void grease_pencil_fill_extension_cut(const bContext &C, /* Upper bound for segment count. Arrays are sized for easy index mapping, exact count isn't * necessary. Not all entries are added to the BVH tree. */ - const int max_bvh_lines = bvh_curve_offsets.total_size(); + const int max_bvh_lines = bvh_curve_offsets.data().last(); /* Cached view positions for lines. */ Array view_starts(max_bvh_lines); Array view_ends(max_bvh_lines);