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:
authorAntonio Vazquez <blendergit@gmail.com>2020-04-02 17:47:52 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-04-02 17:48:00 +0300
commitb75a7c2f8fb81eb7da067128dd90e3cd11406ab4 (patch)
tree7b0543dbb9a592847d8d6822890a6b14b6e6f2b4 /source/blender/blenkernel
parente6c732e0cbe3e9ccb0b279b9e4af68772d7229dc (diff)
Fix T75302: GPencil fill does not work on python generated strokes
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/gpencil.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index fc7f15348bc..b2fc91fd0a6 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -541,7 +541,12 @@ bGPDstroke *BKE_gpencil_stroke_new(int mat_idx, int totpoints, short thickness)
gps->flag = GP_STROKE_3DSPACE;
gps->totpoints = totpoints;
- gps->points = MEM_callocN(sizeof(bGPDspoint) * gps->totpoints, "gp_stroke_points");
+ if (gps->totpoints > 0) {
+ gps->points = MEM_callocN(sizeof(bGPDspoint) * gps->totpoints, "gp_stroke_points");
+ }
+ else {
+ gps->points = NULL;
+ }
/* initialize triangle memory to dummy data */
gps->triangles = NULL;