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:
@@ -2984,6 +2984,9 @@ bGPDstroke *BKE_gpencil_stroke_delete_tagged_points(bGPdata *gpd,
|
|||||||
|
|
||||||
/* Add new stroke to the frame or delete if below limit */
|
/* Add new stroke to the frame or delete if below limit */
|
||||||
if ((limit > 0) && (new_stroke->totpoints <= limit)) {
|
if ((limit > 0) && (new_stroke->totpoints <= limit)) {
|
||||||
|
if (gps_first == new_stroke) {
|
||||||
|
gps_first = NULL;
|
||||||
|
}
|
||||||
BKE_gpencil_free_stroke(new_stroke);
|
BKE_gpencil_free_stroke(new_stroke);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user