summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llmodel.cpp
diff options
context:
space:
mode:
authorBrad Kittenbrink <brad@lindenlab.com>2022-03-07 00:19:11 -0800
committerBrad Kittenbrink <brad@lindenlab.com>2022-03-07 00:19:11 -0800
commit89ab1e4525445d5efc370c381f7c1e18faab8f16 (patch)
tree3e1326470eddea3310bfd15867c9d54dd3b1652c /indra/llprimitive/llmodel.cpp
parent40b80251e48d5f0ae3695d9019261f9e472f3e16 (diff)
parent6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff)
Merge remote-tracking branch 'origin/master' into DRTVWR-550-mfa
Diffstat (limited to 'indra/llprimitive/llmodel.cpp')
-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;