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:
authorBrecht Van Lommel <brecht@blender.org>2022-01-31 22:56:54 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-01-31 22:59:25 +0300
commitc8c9965df272835f0099260580ed8813fc8baf0d (patch)
tree458230ec6995029ae2f5af76ed32f091be23f070 /source/blender/render
parent5fabbedb046d7f27421f607e01b25eee8a6af9f3 (diff)
Fix crash with non-closed meshes in recent bugfix for texture margin
Ref T95249, D13935
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/texture_margin.cc6
1 files changed, 5 insertions, 1 deletions
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;