[Bf-blender-cvs] [c23526ac73f] greasepencil-object: Fix segment fault when draw polygons

Antonio Vazquez noreply at git.blender.org
Tue Aug 15 12:16:23 CEST 2017


Commit: c23526ac73f4c592417d181c8d7cfbf23967a156
Author: Antonio Vazquez
Date:   Tue Aug 15 12:16:07 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBc23526ac73f4c592417d181c8d7cfbf23967a156

Fix segment fault when draw polygons

===================================================================

M	source/blender/editors/gpencil/gpencil_paint.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 45d5707f127..e49122bf922 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -609,7 +609,9 @@ static short gp_stroke_addpoint(const bContext *C, tGPsdata *p, const int mval[2
 			}
 			
 			pts = &gps->points[gps->totpoints - 1];
-			
+			pts->totweight = 0;
+			pts->weights = NULL;
+
 			/* special case for poly lines: normally,
 			 * depth is needed only when creating new stroke from buffer,
 			 * but poly lines are converting to stroke instantly,
@@ -635,6 +637,9 @@ static short gp_stroke_addpoint(const bContext *C, tGPsdata *p, const int mval[2
 			pts->pressure = pt->pressure;
 			pts->strength = pt->strength;
 			pts->time = pt->time;
+			pts->totweight = 0;
+			pts->weights = NULL;
+
 			/* force fill recalc */
 			gps->flag |= GP_STROKE_RECALC_CACHES;
 			/* drawing batch cache is dirty now */




More information about the Bf-blender-cvs mailing list