From 49e07dfdfbe5edf133ec9a5f1ffa7cd8ac05c3a3 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 6 Feb 2019 16:38:03 +0100 Subject: [PATCH] Fix T61190: Crash in particles distribution Was visible with certain configuration only, is a numeric instability caused by degenerate ray direction. Not sure the distribution is correct, just fixing crash which was caused by usage of watertight intersection. --- source/blender/blenlib/intern/math_geom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index aebff346432..f661ac01023 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -1813,7 +1813,7 @@ bool isect_ray_tri_watertight_v3( /* Calculate determinant. */ det = u + v + w; - if (UNLIKELY(det == 0.0f)) { + if (UNLIKELY(det == 0.0f || !isfinite(det))) { return false; } else {