Revision: 35410
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35410
Author:   nazgul
Date:     2011-03-08 20:31:45 +0000 (Tue, 08 Mar 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/brush.c

Modified: trunk/blender/source/blender/blenkernel/intern/brush.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/brush.c      2011-03-08 
19:52:35 UTC (rev 35409)
+++ trunk/blender/source/blender/blenkernel/intern/brush.c      2011-03-08 
20:31:45 UTC (rev 35410)
@@ -732,6 +732,12 @@
 
        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;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to