summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-06-12 09:16:19 -0700
committerGraham Madarasz <graham@lindenlab.com>2013-06-12 09:16:19 -0700
commitd2b253f1f6072beead770519849ad3b18a1a4359 (patch)
treec50dcc7ea602746d156e24a9127721a95f640007 /indra/newview/llvovolume.cpp
parent48324a93833cee8aca7559588ee5f2b4afa250fa (diff)
Changes to protect against use of normalize3fast on degenerate vectors
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rwxr-xr-xindra/newview/llvovolume.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 0aa56fcc0f..8962d7cadf 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3751,7 +3751,8 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
{
*normal = n;
}
-
+ // guard against NaNs in normalize below
+ llassert(normal->dot3(*normal).getF32() > F_APPROXIMATELY_ZERO);
(*normal).normalize3fast();
}
@@ -3774,6 +3775,8 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
{
*tangent = tn;
}
+ // guard against NaNs in normalize below
+ llassert(tangent->dot3(*tangent).getF32() > F_APPROXIMATELY_ZERO);
(*tangent).normalize3fast();
}