diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-11-29 18:27:19 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-11-29 18:27:29 +0300 |
commit | 1321be0af9f67b40f8c481ee6a9d42482215bbb5 (patch) | |
tree | e6d63122eec0cad46352d44f76374033cf2d25ff | |
parent | 3a5d398aaf552c5c5b8662d259bffe3287dc1992 (diff) |
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.
-rw-r--r-- | source/blender/editors/gpencil/gpencil_interpolate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 3c4d43b5f53..ec26006eb06 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -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); } |