Commit: 6950c9659d51832dfc6b9239ebbc11affde8d25c
Author: Jeroen Bakker
Date:   Tue Jan 17 12:16:45 2023 +0100
Branches: temp-T101739-fix-seam-bleeding-non-manifold
https://developer.blender.org/rB6950c9659d51832dfc6b9239ebbc11affde8d25c

Fix out of bounds read due to naming confusion. Clamp vs isect.

===================================================================

M       source/blender/blenkernel/intern/pbvh_pixels_copy.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_copy.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_copy.cc
index 74db2c457b6..c20fe04b93e 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_copy.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_copy.cc
@@ -70,9 +70,8 @@ void add_margin(rcti &bounds, int margin)
 void clamp(rcti &bounds, int2 resolution)
 {
   rcti clamping_bounds;
-  int2 xy;
   BLI_rcti_init(&clamping_bounds, 0, resolution.x - 1, 0, resolution.y - 1);
-  BLI_rcti_clamp(&bounds, &clamping_bounds, xy);
+  BLI_rcti_isect(&bounds, &clamping_bounds, &bounds);
 }
 
 const Vertex<CoordSpace::Tile> convert_coord_space(const 
Vertex<CoordSpace::UV> &uv_vertex,
@@ -471,6 +470,13 @@ struct Rows {
 
     static void extend_last_group(CopyPixelTile &tile_pixels, const 
CopyPixelCommand &command)
     {
+      /*
+      printf("(%d,%d) = mix((%d,%d), (%d,%d), %f);\n",
+             UNPACK2(command.destination),
+             UNPACK2(command.source_1),
+             UNPACK2(command.source_2),
+             command.mix_factor);
+             */
       CopyPixelGroup &group = tile_pixels.groups.last();
       CopyPixelCommand last_command = last_copy_command(tile_pixels, group);
       DeltaCopyPixelCommand delta_command = last_command.encode_delta(command);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to