From 250212d614982041ad553428f76733f6ddd4e224 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 29 Apr 2021 00:09:00 +0300 Subject: SL-15183 Crash at LLModel::matchMaterialOrder --- indra/llprimitive/llmodel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llprimitive') 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."< 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 index_map; -- cgit v1.2.3