[Bf-blender-cvs] [012f7ca] blender-v2.73-release: Fix invalid memory access in gradient brushes - could cause a crash in MacOS.

Antony Riakiotakis noreply at git.blender.org
Tue Jan 20 10:23:18 CET 2015


Commit: 012f7ca1b59673157e397070182cd051209d1f1a
Author: Antony Riakiotakis
Date:   Wed Jan 7 23:01:42 2015 +0100
Branches: blender-v2.73-release
https://developer.blender.org/rB012f7ca1b59673157e397070182cd051209d1f1a

Fix invalid memory access in gradient brushes - could cause a crash in
MacOS.

This looks like an oldie and should not influence release, but if we do
make an 'a' build it's safe to include.

Report by Craig Jones, thanks!

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

M	source/blender/editors/sculpt_paint/paint_image.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index a13a2f2..7c8aa1b 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -662,22 +662,24 @@ void paint_brush_color_get(struct Scene *scene, struct Brush *br, bool color_cor
 		copy_v3_v3(color, BKE_brush_secondary_color_get(scene, br));
 	else {
 		if (br->flag & BRUSH_USE_GRADIENT) {
+			float color_gr[4];
 			switch (br->gradient_stroke_mode) {
 				case BRUSH_GRADIENT_PRESSURE:
-					do_colorband(br->gradient, pressure, color);
+					do_colorband(br->gradient, pressure, color_gr);
 					break;
 				case BRUSH_GRADIENT_SPACING_REPEAT:
 				{
 					float coord = fmod(distance / br->gradient_spacing, 1.0);
-					do_colorband(br->gradient, coord, color);
+					do_colorband(br->gradient, coord, color_gr);
 					break;
 				}
 				case BRUSH_GRADIENT_SPACING_CLAMP:
 				{
-					do_colorband(br->gradient, distance / br->gradient_spacing, color);
+					do_colorband(br->gradient, distance / br->gradient_spacing, color_gr);
 					break;
 				}
 			}
+			copy_v3_v3(color, color_gr);
 		}
 		else
 			copy_v3_v3(color, BKE_brush_color_get(scene, br));




More information about the Bf-blender-cvs mailing list