[Bf-blender-cvs] [d76b27e766a] greasepencil-object: Fix bug of memory corruption

Antonio Vazquez noreply at git.blender.org
Thu Oct 12 11:28:29 CEST 2017


Commit: d76b27e766a98fb63476a1658c4452050ac3985d
Author: Antonio Vazquez
Date:   Thu Oct 12 11:28:18 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBd76b27e766a98fb63476a1658c4452050ac3985d

Fix bug of memory corruption

The strokes were transparent and zdepth was doing weird things when using 2 GP objects. This error was introduced by commit: 27/09/2017 08:34 5c8e1dfc2851a539abaa988762f1c590038e51bb

The problem was the field xray_mode. If move below in the struct, the value is corrupted and draw manager does not work fine..

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

M	source/blender/makesdna/DNA_gpencil_types.h

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

diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index fb8e4ccd3e2..e0043d900e8 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -392,8 +392,9 @@ typedef struct bGPdata {
 	short sflag;                /* settings for palette color */
 	short bstroke_style;        /* buffer style for drawing strokes (used to select shader type) */
 	short bfill_style;          /* buffer style for filling areas (used to select shader type) */
-	char pad3[2];
-	 
+
+	short xray_mode;            /* xray mode for strokes */
+
 	/* Palettes */
 	ListBase palettes;          /* list of bGPDpalette's   - Deprecated (2.78 - 2.79 only) */
 	
@@ -401,10 +402,9 @@ typedef struct bGPdata {
 	struct GHash *batch_cache_data;
 	
 	char last_palette_name[66]; /* name of the last palette used */
-	char pad[4];
+	char pad[6];
 	
 	/* 3D Viewport/Appearance Settings */
-	short xray_mode;            /* xray mode for strokes (eGP_DepthOrdering) */
 	int pixfactor;              /* factor to define pixel size conversion */
 	float line_color[4];        /* color for edit line */
 
@@ -417,10 +417,10 @@ typedef struct bGPdata {
 
 	float gcolor_prev[3];	    /* optional color for ghosts before the active frame */
 	float gcolor_next[3];	    /* optional color for ghosts after the active frame */
-	
+
 	/* Palette Slots */
 	int active_palette_slot;    /* index of active palette slot */
-	
+
 	ListBase palette_slots;     /* list of bGPDpaletteref's - (2.8+) */
 } bGPdata;



More information about the Bf-blender-cvs mailing list