summaryrefslogtreecommitdiff
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
commit750d90cf592d22b9c717fa138f17b2c1e32dd1c7 (patch)
treeaa561487794d06d8bfe3d3630c3fb54427190443
parentbafe54c1fe5f83552a6be6c10b0f3b6e3ef69859 (diff)
MAINT-8208 [Mac] Viewer crashes when uploading certain mesh model after enabling "Include skin weight"
-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();