Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2021-06-23 00:11:46 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-06-23 00:12:04 +0300
commitdbc054bb8818b51c8148a9e245cd75e0198515a0 (patch)
tree372ad1eb273c667891cebee5432428d6b4a1b450 /source
parentabb07a38b842accd685dd6a065aa25b85e12a52d (diff)
Fix T89374: Erasing/cutting in Grease Pencil makes Blender shut down
When cut a stroke of 1 point, the clean up done to avoid keep 1 point strokes removes the memory, but the pointer to the first stroke was not set to NULL. As this pointer is invalid now, any use of this produces a segment fault because the pointer is corrupted..
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/gpencil_geom.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_geom.c b/source/blender/blenkernel/intern/gpencil_geom.c
index 7f839650f33..982fc2abd65 100644
--- a/source/blender/blenkernel/intern/gpencil_geom.c
+++ b/source/blender/blenkernel/intern/gpencil_geom.c
@@ -2984,6 +2984,9 @@ bGPDstroke *BKE_gpencil_stroke_delete_tagged_points(bGPdata *gpd,
/* Add new stroke to the frame or delete if below limit */
if ((limit > 0) && (new_stroke->totpoints <= limit)) {
+ if (gps_first == new_stroke) {
+ gps_first = NULL;
+ }
BKE_gpencil_free_stroke(new_stroke);
}
else {