diff options
author | Graham Madarasz <graham@lindenlab.com> | 2013-06-12 09:16:19 -0700 |
---|---|---|
committer | Graham Madarasz <graham@lindenlab.com> | 2013-06-12 09:16:19 -0700 |
commit | d2b253f1f6072beead770519849ad3b18a1a4359 (patch) | |
tree | c50dcc7ea602746d156e24a9127721a95f640007 /indra/newview/llspatialpartition.cpp | |
parent | 48324a93833cee8aca7559588ee5f2b4afa250fa (diff) |
Changes to protect against use of normalize3fast on degenerate vectors
Diffstat (limited to 'indra/newview/llspatialpartition.cpp')
-rwxr-xr-x | indra/newview/llspatialpartition.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 78401020a6..dc99fd469b 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1259,12 +1259,15 @@ F32 LLSpatialPartition::calcDistance(LLSpatialGroup* group, LLCamera& camera) F32 dist = 0.f; + LLVector4a default_eyevec; + default_eyevec.set(0,0,1,1); + if (group->mDrawMap.find(LLRenderPass::PASS_ALPHA) != group->mDrawMap.end()) { LLVector4a v = eye; dist = eye.getLength3().getF32(); - eye.normalize3fast(); + eye.normalize3fast_checked(&default_eyevec); if (!group->isState(LLSpatialGroup::ALPHA_DIRTY)) { |