[Bf-blender-cvs] [c8c9965df27] blender-v3.1-release: Fix crash with non-closed meshes in recent bugfix for texture margin

Brecht Van Lommel noreply at git.blender.org
Mon Jan 31 21:00:06 CET 2022


Commit: c8c9965df272835f0099260580ed8813fc8baf0d
Author: Brecht Van Lommel
Date:   Mon Jan 31 20:56:54 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rBc8c9965df272835f0099260580ed8813fc8baf0d

Fix crash with non-closed meshes in recent bugfix for texture margin

Ref T95249, D13935

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

M	source/blender/render/intern/texture_margin.cc

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

diff --git a/source/blender/render/intern/texture_margin.cc b/source/blender/render/intern/texture_margin.cc
index bb4b82645f0..5a9d9db5367 100644
--- a/source/blender/render/intern/texture_margin.cc
+++ b/source/blender/render/intern/texture_margin.cc
@@ -349,13 +349,17 @@ class TextureMarginMap {
      * But it seems fast enough for now and that would add a lot of complexity. */
     for (int i = 0; i < totloop; i++) {
       int otherloop = loop_adjacency_map_[i + loopstart];
+
+      if (otherloop < 0) {
+        continue;
+      }
+
       uint32_t poly = loop_to_poly_map_[otherloop];
 
       if (lookup_pixel(x, y, poly, &destx, &desty, &foundpoly, &found_dist)) {
         if (mindist < 0.f || found_dist < mindist) {
           mindist = found_dist;
           *r_other_poly = foundpoly;
-          ;
           *r_destx = destx;
           *r_desty = desty;
           *r_start_poly = poly;



More information about the Bf-blender-cvs mailing list