[Bf-blender-cvs] [bbca6af6a5a] blender2.8: Fix crash in grease pencil fill

Campbell Barton noreply at git.blender.org
Fri Oct 12 01:22:26 CEST 2018


Commit: bbca6af6a5aac08fa15da3f15de650e441dce269
Author: Campbell Barton
Date:   Fri Oct 12 10:22:05 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBbbca6af6a5aac08fa15da3f15de650e441dce269

Fix crash in grease pencil fill

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 8acd79ba7d9..61a21022e22 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -636,7 +636,7 @@ static  void gpencil_get_outline_points(tGPDfill *tgpf)
 	bool start_found = false;
 	const int NEIGHBOR_COUNT = 8;
 
-	int offset[8][2] = {
+	const int offset[8][2] = {
 		{ -1, -1 },
 		{ 0, -1 },
 		{ 1, -1 },
@@ -653,7 +653,7 @@ static  void gpencil_get_outline_points(tGPDfill *tgpf)
 	int imagesize = ibuf->x * ibuf->y;
 
 	/* find the initial point to start outline analysis */
-	for (int idx = imagesize; idx >= 0; idx--) {
+	for (int idx = imagesize - 1; idx != 0; idx--) {
 		get_pixel(ibuf, idx, rgba);
 		if (rgba[1] == 1.0f) {
 			boundary_co[0] = idx % ibuf->x;



More information about the Bf-blender-cvs mailing list