From 370cbd429d3763405795a95cb9355a302b56014a Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 17 Oct 2014 19:57:33 +0300 Subject: MAINT-4515 FIXED [loader mods] viewer crashed when uploading a large mesh --- indra/llprimitive/lldaeloader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 80bb0cd265..945b691196 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -2287,7 +2287,10 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector& mo next->getVolumeFaces() = remainder; next->mNormalizedScale = ret->mNormalizedScale; next->mNormalizedTranslation = ret->mNormalizedTranslation; - next->mMaterialList.assign(ret->mMaterialList.begin() + LL_SCULPT_MESH_MAX_FACES, ret->mMaterialList.end()); + if ( ret->mMaterialList.size() > LL_SCULPT_MESH_MAX_FACES) + { + next->mMaterialList.assign(ret->mMaterialList.begin() + LL_SCULPT_MESH_MAX_FACES, ret->mMaterialList.end()); + } ret = next; } -- cgit v1.2.3