From 79212e759b19761726baad29845a505e034dc014 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 20 Oct 2014 11:11:45 +0300 Subject: MAINT-4533 FIXED viewer crash when uploading shiprigging88b.dae --- indra/llprimitive/llmodel.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra') 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 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; -- cgit v1.2.3