[Bf-blender-cvs] [ae18fd5] master: Fix invalid memory access in gradient brushes - could cause a crash in MacOS.
Antony Riakiotakis
noreply at git.blender.org
Wed Jan 7 23:02:29 CET 2015
Commit: ae18fd5937753d1fc420dc8aef78efacabb9750c
Author: Antony Riakiotakis
Date: Wed Jan 7 23:01:42 2015 +0100
Branches: master
https://developer.blender.org/rBae18fd5937753d1fc420dc8aef78efacabb9750c
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 82d7130..d52b173 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