GPencil: Fix unreported segment fault drawing with dots
authorAntonioya <blendergit@gmail.com>
Wed, 6 Mar 2019 18:31:01 +0000 (19:31 +0100)
committerAntonioya <blendergit@gmail.com>
Wed, 6 Mar 2019 18:31:01 +0000 (19:31 +0100)
source/blender/draw/engines/gpencil/gpencil_draw_utils.c

index d8ebae744e2b7a8b5d20f79f511346e1c2cd6a68..a96d293c381fea4788b16fd4e591bfccbdbe23a0 100644 (file)
@@ -683,17 +683,15 @@ static DRWShadingGroup *DRW_gpencil_shgroup_point_create(
                }
                /* viewport x-ray */
                DRW_shgroup_uniform_int(grp, "viewport_xray", &stl->storage->is_xray, 1);
-
-               stl->shgroups[id].shading_type[0] = (int)OB_RENDER;
-               DRW_shgroup_uniform_int(grp, "shading_type", &stl->shgroups[id].shading_type[0], 2);
+               DRW_shgroup_uniform_int(grp, "shading_type", (const int *)&stl->storage->shade_render, 2);
        }
 
-       if (gpd) {
+       if ((gpd) && (id > -1)) {
                stl->shgroups[id].xray_mode = (ob->dtx & OB_DRAWXRAY) ? GP_XRAY_FRONT : GP_XRAY_3DSPACE;
                DRW_shgroup_uniform_int(grp, "xraymode", (const int *)&stl->shgroups[id].xray_mode, 1);
        }
        else {
-               /* for drawing always on on predefined z-depth */
+               /* for drawing always on predefined z-depth */
                DRW_shgroup_uniform_int(grp, "xraymode", &stl->storage->xray, 1);
        }