[Bf-blender-cvs] [91407293bf6] greasepencil-object: Fix segment fault with Dupli modifier
Antonio Vazquez
noreply at git.blender.org
Tue Aug 8 11:19:20 CEST 2017
Commit: 91407293bf6c5eecb79fdcc8db2db20ba5a035a2
Author: Antonio Vazquez
Date: Mon Aug 7 12:13:02 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB91407293bf6c5eecb79fdcc8db2db20ba5a035a2
Fix segment fault with Dupli modifier
This error was introduced after adding support for modifiers in edit mode
===================================================================
M source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 9b2aa0ed935..f590084f91c 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -631,8 +631,18 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, GPENCIL_e_data *e_dat
}
}
int gps_idx = -1;
- for (gps = derived_gpf->strokes.first, src_gps = src_gpf->strokes.first; gps; gps = gps->next, src_gps = src_gps->next) {
+
+ if (src_gpf) {
+ src_gps = src_gpf->strokes.first;
+ }
+ else {
+ src_gps = NULL;
+ }
+
+ for (gps = derived_gpf->strokes.first; gps; gps = gps->next) {
++gps_idx;
+
+
/* check if stroke can be drawn */
if (gpencil_can_draw_stroke(gps, onion) == false) {
continue;
@@ -682,10 +692,14 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, GPENCIL_e_data *e_dat
gpencil_add_stroke_shgroup(cache, strokegrp, ob, gpd, gpl, derived_gpf, gps, opacity, tintcolor, onion, custonion);
/* edit points (only in edit mode) */
- if (!onion) {
+ if ((!onion) && (src_gps)){
gpencil_add_editpoints_shgroup(stl, cache, ts, ob, gpd, gpl, derived_gpf, src_gps);
}
+ if (src_gps) {
+ src_gps = src_gps->next;
+ }
+
++cache->cache_idx;
}
}
More information about the Bf-blender-cvs
mailing list