Fix #128461: GPv3: Crash importing svg with more than one drawing

Wrong `points_num` when resizing the `CurvesGeometry`.
Otherwise, any attriute span will have wrong size, this triggers crash
when writing value in these attribute spans.

Pull Request: https://projects.blender.org/blender/blender/pulls/128472
This commit is contained in:
Pratik Borhade
2024-10-02 11:48:28 +02:00
committed by Pratik Borhade
parent 78e330923d
commit d7fb60be4d

View File

@@ -146,7 +146,7 @@ static IndexRange extend_curves_geometry(bke::CurvesGeometry &curves, const NSVG
const IndexRange new_curves_range = {old_curves_num, new_points_by_curve.size()};
const int curves_num = new_curves_range.one_after_last();
const int points_num = new_points_by_curve.total_size();
const int points_num = new_points_by_curve.total_size() + old_points_num;
Array<int> new_offsets(curves_num + 1);
if (old_curves_num > 0) {