diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-05-10 00:29:57 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-05-10 00:30:19 +0400 |
commit | f622691691547bb364fe6a560124583030d55c11 (patch) | |
tree | a27dfcefa88961177796b5bc3c323d7582e99fa8 /source/blender/editors/sculpt_paint/paint_image_2d.c | |
parent | c80e9866c8615c1742bc74506f8c8fe574552777 (diff) |
Fix access violation when painting with tiled textured brushes +
airbrush + small brush size.
Fast textured strokes meant that sometimes the update width (calculated
from stroke distance) would be greater than the new ibuf width. This
meant out of bounds access for the new ibuf.
It's totally strange that I couldn't reproduce this issue on older
versions since the logic here has not really changed much between
versions.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_2d.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_2d.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index 16dacaebfb1..667b487d4b1 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -491,8 +491,8 @@ static void brush_painter_imbuf_partial_update(BrushPainter *painter, const floa w = h = 0; } - x1 = destx; - y1 = desty; + x1 = min_ii(destx, ibuf->x); + y1 = min_ii(desty, ibuf->y); x2 = min_ii(destx + w, ibuf->x); y2 = min_ii(desty + h, ibuf->y); |