Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2010-07-29 06:29:32 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2010-07-29 06:29:32 +0400
commit4e405a9f3e2d13562515467f99775b1c7f6d496d (patch)
tree38c01d83b65bac16b731a5dc9c8ae09c8905e193 /source
parent88cbcb0206b7f727b24c6018a24dc1c1a08e9531 (diff)
Fixed some potential memory corruption
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c15
2 files changed, 6 insertions, 11 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 634829060b4..814b30a6673 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -789,7 +789,7 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *ev
Paint *paint = paint_get_active(CTX_data_scene(C)); // XXX
Brush *brush = paint_brush(paint); // XXX
- float mouse[2];
+ float mouse[3];
PointerRNA itemptr;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 546fbc14dfa..27d2d668790 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -3073,20 +3073,15 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, SculptSession
cache->special_rotation = atan2(dx, dy) + M_PI;
if (brush->flag & BRUSH_EDGE_TO_EDGE) {
- float d[3];
- float halfway[3];
+ float halfway[2];
float out[3];
- d[0] = dx;
- d[1] = dy;
- d[2] = 0;
-
- mul_v3_v3fl(halfway, d, 0.5f);
- add_v3_v3(halfway, cache->initial_mouse);
+ halfway[0] = dx*0.5 + cache->initial_mouse[0];
+ halfway[1] = dy*0.5 + cache->initial_mouse[1];
if (sculpt_stroke_get_location(C, stroke, out, halfway)) {
copy_v3_v3(sd->anchored_location, out);
- copy_v3_v3(sd->anchored_initial_mouse, halfway);
+ copy_v2_v2(sd->anchored_initial_mouse, halfway);
copy_v2_v2(cache->tex_mouse, halfway);
copy_v3_v3(cache->true_location, sd->anchored_location);
sd->anchored_size /= 2.0f;
@@ -3114,7 +3109,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, SculptSession
const float dy = cache->last_rake[1] - cache->mouse[1];
if (cache->first_time) {
- copy_v3_v3(cache->last_rake, cache->mouse);
+ copy_v2_v2(cache->last_rake, cache->mouse);
}
else if (dx*dx + dy*dy >= r*r) {
cache->special_rotation = atan2(dx, dy);