summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2018-01-22 18:11:12 +0200
committermaxim_productengine <mnikolenko@productengine.com>2018-01-22 18:11:12 +0200
commit460c28b45631c6282200628d0725672ce5679490 (patch)
treeddcfbab9a28b97a924efae0968e811b09d95fafc /indra/llprimitive
parent78f96e6f0a5eaa1c740ab1dd66ec7e56b0db8bb2 (diff)
MAINT-8208 [Mac] Viewer crashes when uploading certain mesh model after enabling "Include skin weight"
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llmodel.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 29af859cd0..8fbb4f6b96 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1034,8 +1034,11 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
{ //no exact match found, get closest point
const F32 epsilon = 1e-5f;
weight_map::iterator iter_up = mSkinWeights.lower_bound(pos);
- weight_map::iterator iter_down = ++iter_up;
-
+ weight_map::iterator iter_down = iter_up;
+ if (iter_up != mSkinWeights.end())
+ {
+ iter_down = ++iter_up;
+ }
weight_map::iterator best = iter_up;
F32 min_dist = (iter->first - pos).magVec();