[Bf-blender-cvs] [e80c6c48aaf] temp-T97352-3d-texturing-seam-bleeding: Add early exits to skip bitmaps.

Jeroen Bakker noreply at git.blender.org
Mon May 2 14:33:58 CEST 2022


Commit: e80c6c48aaf6f934172ea2ce1b239e486d003fec
Author: Jeroen Bakker
Date:   Mon May 2 13:34:42 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rBe80c6c48aaf6f934172ea2ce1b239e486d003fec

Add early exits to skip bitmaps.

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

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

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

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index dac1398d411..c2d68a3a380 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -379,6 +379,11 @@ static void build_fixes(PBVH &pbvh,
                         const MLoopUV &luv_b_2,
                         const float scale_factor)
 {
+  if (uvbounds.xmax < 0 || uvbounds.ymax < 0 || uvbounds.xmin > bitmap.resolution.x ||
+      uvbounds.ymin > bitmap.resolution.y) {
+    return;
+  }
+
   for (int v = uvbounds.ymin; v <= uvbounds.ymax; v++) {
     for (int u = uvbounds.xmin; u <= uvbounds.xmax; u++) {
       if (u < 0 || u >= bitmap.resolution.x || v < 0 || v >= bitmap.resolution.y) {
@@ -488,6 +493,11 @@ static void build_fixes(PBVH &pbvh,
 static void build_fixes(
     PBVH &pbvh, Bitmap &bitmap, const rcti &uvbounds, const MLoopUV &luv_1, const MLoopUV &luv_2)
 {
+  if (uvbounds.xmax < 0 || uvbounds.ymax < 0 || uvbounds.xmin > bitmap.resolution.x ||
+      uvbounds.ymin > bitmap.resolution.y) {
+    return;
+  }
+
   for (int v = uvbounds.ymin; v <= uvbounds.ymax; v++) {
     for (int u = uvbounds.xmin; u <= uvbounds.xmax; u++) {
       if (u < 0 || u >= bitmap.resolution[0] || v < 0 || v >= bitmap.resolution[1]) {



More information about the Bf-blender-cvs mailing list