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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-13 01:23:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-13 01:23:02 +0400
commit613f464c51fbaa759e45b8b22ede47c8aea9382f (patch)
tree07ba28ad38668fc0e6f02d77bdc41e8098e6114d
parent7413ab8f1f4521f3ae2828cb0aa3bbf3bc1c0e2a (diff)
fix [#31427] Crash when undoing until no point in grease pencil poly mode
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index b79c510efce..628f3aefa77 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -321,7 +321,12 @@ static short gp_stroke_addpoint(tGPsdata *p, const int mval[2], float pressure)
{
bGPdata *gpd = p->gpd;
tGPspoint *pt;
-
+
+ /* sanity check, can happen after undo [#31427] */
+ if (p->flags & GP_PAINTFLAG_STROKEADDED && p->gpf->strokes.last == NULL) {
+ p->flags &= ~GP_PAINTFLAG_STROKEADDED;
+ }
+
/* check painting mode */
if (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT) {
/* straight lines only - i.e. only store start and end point in buffer */