diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-15 20:15:40 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-15 20:15:40 +0100 |
commit | 5dda65c0303d0e3c38e4ab57c26759937af0eeb2 (patch) | |
tree | 5178c7804e34de151529a67f844b3f21e0f0d2e7 /indra/llrender | |
parent | 59446d550522660c47065622812308da190d6a89 (diff) |
EXT-4388 Crash in octree line segment intersection code (getMask)
Add yet more paranoia-and-return-or-assert, this time for +-INF in input vector.
To be reviewed by Bao.
(transplanted from 2012f21d23c66179345fb26148cfbe19835b325e)
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 8addee606b..ff47c57c70 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1738,8 +1738,18 @@ BOOL LLImageGL::getMask(const LLVector2 &tc) if (mPickMask) { - F32 u = tc.mV[0] - floorf(tc.mV[0]); - F32 v = tc.mV[1] - floorf(tc.mV[1]); + F32 u,v; + if (LL_LIKELY(tc.isFinite())) + { + u = tc.mV[0] - floorf(tc.mV[0]); + v = tc.mV[1] - floorf(tc.mV[1]); + } + else + { + LL_WARNS_ONCE("render") << "Ugh, non-finite u/v in mask pick" << LL_ENDL; + u = v = 0.f; + llassert(false); + } if (LL_UNLIKELY(u < 0.f || u > 1.f || v < 0.f || v > 1.f)) |