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
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-03-08 23:31:45 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2011-03-08 23:31:45 +0300
commita193b14c2514e93949773cb1e65462baa68d3349 (patch)
tree40f801c4efc6acf62d27009b43e11d7798961fbb /source/blender/blenkernel/intern/brush.c
parent1dc1b01c2a8e7394c5bb43da9ca6ba574758786c (diff)
Prevent memory corruption when using fixed texture and fast strokes with
big spacing. Not sure if it's the best solution or it should be fixed when calculating new areas. It'll be cool if somebody else familiar with this area will check this.
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r--source/blender/blenkernel/intern/brush.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 6e9c383f2a6..869123de97f 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -732,6 +732,12 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf, i
dotexold = (oldtexibuf != NULL);
+ /* not sure if it's actually needed or it's a mistake in coords/sizes
+ calculation in brush_painter_fixed_tex_partial_update(), but without this
+ limitation memory gets corrupted at fast strokes with quite big spacing (sergey) */
+ w = MIN2(w, ibuf->x);
+ h = MIN2(h, ibuf->y);
+
if (painter->cache.flt) {
for (; y < h; y++) {
bf = ibuf->rect_float + (y*ibuf->x + origx)*4;