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:
authorAntonioya <blendergit@gmail.com>2016-08-10 16:51:40 +0300
committerAntonioya <blendergit@gmail.com>2016-08-10 16:51:40 +0300
commitebdb5490b3a63e37ac5638f8a06737cf34ba36d3 (patch)
treea95f4508760da880aad80b6a5c055daad1c4d0c8 /source/blender/makesrna/intern/rna_gpencil.c
parent774beb7c3cf04cc42703a4a6ebb9a4836690b060 (diff)
GPencil: Avoid segment fault if new stroke function is called without colorname
Diffstat (limited to 'source/blender/makesrna/intern/rna_gpencil.c')
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 7424c190501..9476c964b40 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -482,7 +482,9 @@ static void rna_GPencil_stroke_point_pop(bGPDstroke *stroke, ReportList *reports
static bGPDstroke *rna_GPencil_stroke_new(bGPDframe *frame, const char *colorname)
{
bGPDstroke *stroke = MEM_callocN(sizeof(bGPDstroke), "gp_stroke");
- strcpy(stroke->colorname, colorname);
+ if (colorname) {
+ strcpy(stroke->colorname, colorname);
+ }
stroke->palcolor = NULL;
stroke->flag |= GP_STROKE_RECALC_COLOR;
BLI_addtail(&frame->strokes, stroke);