diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-03-13 14:57:08 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-03-13 14:57:59 +0300 |
commit | db4298c6bec8f0be71c8258071d1469927c53658 (patch) | |
tree | 2b45ea5d183c5fb4ace0945c3339526237459938 /source/blender/blenkernel/intern | |
parent | cb19bb7f57f34c25fbc6baaa802f5935c8925131 (diff) |
GPencil: Avoid segment fault when use Simplify modifier
The number of points of the evaluated stroke can be less than original or the original can use less points that evaluated.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 6cd2d36c188..c587e433e7f 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -3909,6 +3909,9 @@ void BKE_gpencil_frame_original_pointers_update(const struct bGPDframe *gpf_orig /* Assign original point pointer. */ for (int i = 0; i < gps_orig->totpoints; i++) { + if (i > gps_eval->totpoints - 1) { + break; + } bGPDspoint *pt_eval = &gps_eval->points[i]; pt_eval->runtime.pt_orig = &gps_orig->points[i]; pt_eval->runtime.idx_orig = i; |