diff options
author | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2014-10-20 11:11:45 +0300 |
---|---|---|
committer | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2014-10-20 11:11:45 +0300 |
commit | 79212e759b19761726baad29845a505e034dc014 (patch) | |
tree | eac42d9b8e9589db9aa9f8a55a3bde035c33e916 /indra/llprimitive | |
parent | 7e4ec481aee7287e98e44767b10968302426c3ff (diff) |
MAINT-4533 FIXED viewer crash when uploading shiprigging88b.dae
Diffstat (limited to 'indra/llprimitive')
-rwxr-xr-x | indra/llprimitive/llmodel.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 0801dc96bf..d82075f9a4 100755 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -128,10 +128,14 @@ void LLModel::sortVolumeFacesByMaterialName() { std::vector<MaterialBinding> bindings; bindings.resize(mVolumeFaces.size()); + for (int i = 0; i < bindings.size(); i++) { bindings[i].index = i; - bindings[i].matName = mMaterialList[i]; + if(i < mMaterialList.size()) + { + bindings[i].matName = mMaterialList[i]; + } } std::sort(bindings.begin(), bindings.end(), MaterialSort()); std::vector< LLVolumeFace > new_faces; @@ -142,7 +146,10 @@ void LLModel::sortVolumeFacesByMaterialName() for (int i = 0; i < bindings.size(); i++) { new_faces[i] = mVolumeFaces[bindings[i].index]; - mMaterialList[i] = bindings[i].matName; + if(i < mMaterialList.size()) + { + mMaterialList[i] = bindings[i].matName; + } } mVolumeFaces = new_faces; |