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..
This commit is contained in:
parent
abb07a38b8
commit
dbc054bb88
Notes:
blender-bot
2023-02-13 23:16:02 +01:00
Referenced by issue #89374, Erasing/cutting in Grease Pencil makes Blender shut down.
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue