GPencil: Fix error when interpolate sequence strokes with weights

When the final stroke was smaller than original stroke, the weights array must be resized, but by error the function used the original stroke pointer instead of the new stroke pointer and this corrupted the pointers.
This commit is contained in:
Antonio Vazquez 2019-11-29 16:27:19 +01:00
parent 3a5d398aaf
commit 1321be0af9
Notes: blender-bot 2023-02-14 00:05:38 +01:00
Referenced by issue #72020, GPencil: deleting interpolated frames causes crash
1 changed files with 2 additions and 2 deletions

View File

@ -1052,8 +1052,8 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op)
/* if destination stroke is smaller, resize new_stroke to size of gps_to stroke */
if (gps_from->totpoints > gps_to->totpoints) {
/* free weights of removed points */
if (gps_from->dvert != NULL) {
BKE_defvert_array_free_elems(gps_from->dvert + gps_to->totpoints,
if (new_stroke->dvert != NULL) {
BKE_defvert_array_free_elems(new_stroke->dvert + gps_to->totpoints,
gps_from->totpoints - gps_to->totpoints);
}