From: abn Date: Thu, 11 Apr 2024 14:14:34 +0000 (+0200) Subject: Minor bug fix seen by '-fsanitize' X-Git-Tag: V9_13_0a1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4f2c6c86db3a3f102c169597982dc6f885a26e19;p=tools%2Fmedcoupling.git Minor bug fix seen by '-fsanitize' --- diff --git a/src/INTERP_KERNEL/TransformedTriangleIntersect.cxx b/src/INTERP_KERNEL/TransformedTriangleIntersect.cxx index 9fc3a1674..36727ef26 100644 --- a/src/INTERP_KERNEL/TransformedTriangleIntersect.cxx +++ b/src/INTERP_KERNEL/TransformedTriangleIntersect.cxx @@ -342,9 +342,14 @@ namespace INTERP_KERNEL for(int j = 0 ; j < 2; ++j) { const int dpIdx = DP_INDEX[3*facets[j] + i]; - const DoubleProduct dp = DP_FOR_SEG_FACET_INTERSECTION[dpIdx]; - const double sign = SIGN_FOR_SEG_FACET_INTERSECTION[dpIdx]; - c[j] = dpIdx < 0.0 ? 0.0 : sign * calcStableC(seg, dp); + if (dpIdx != -1) + { + const DoubleProduct dp = DP_FOR_SEG_FACET_INTERSECTION[dpIdx]; + const double sign = SIGN_FOR_SEG_FACET_INTERSECTION[dpIdx]; + c[j] = sign * calcStableC(seg, dp); + } + else + c[j] = 0.0; } pt[i] = (c[0] * s[0] + c[1] * s[1]) / denominator;