summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-04-29 00:09:00 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-04-29 00:11:25 +0300
commit250212d614982041ad553428f76733f6ddd4e224 (patch)
tree25806ae5b8669dfcf913c92230667ef767cfa650 /indra/llprimitive
parent5cde118ec848cc9053a3a502daeecb417c8cfc18 (diff)
SL-15183 Crash at LLModel::matchMaterialOrder
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llmodel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 702a1b5238..1b34068ece 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1262,6 +1262,14 @@ bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCn
LL_INFOS("MESHSKININFO")<<"Material of model is not a subset of reference."<<LL_ENDL;
return false;
}
+
+ if (mMaterialList.size() > ref->mMaterialList.size())
+ {
+ LL_INFOS("MESHSKININFO") << "Material of model has more materials than a reference." << LL_ENDL;
+ // We passed isMaterialListSubset, so materials are a subset, but subset isn't supposed to be
+ // larger than original and if we keep going, reordering will cause a crash
+ return false;
+ }
std::map<std::string, U32> index_map;