summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-09-22 15:31:49 -0500
committerRunitaiLinden <davep@lindenlab.com>2023-09-22 15:31:49 -0500
commit3da26ee8df6cc7e57ba3acbb91437ec97e151002 (patch)
tree08fe437354abc1d69220e88d646b7b77cb504b10
parent813acc39feec14b0c78fd9f704b358331ff87896 (diff)
SL-20321 Fix for missing "has_te" check (thanks Henri)
-rw-r--r--indra/newview/llgltfmateriallist.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp
index a92e699c42..8919229c78 100644
--- a/indra/newview/llgltfmateriallist.cpp
+++ b/indra/newview/llgltfmateriallist.cpp
@@ -360,8 +360,8 @@ void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::s
constexpr U32 MAX_TES = 45;
bool has_te[MAX_TES] = { false };
- if (tes.isArray())
- {
+ if (tes.isArray()) // NOTE: if no "te" array exists, this is a malformed message (null out all overrides will come in as an empty te array)
+ {
LLGLTFOverrideCacheEntry cache;
cache.mLocalId = local_id;
cache.mObjectId = id;
@@ -395,7 +395,7 @@ void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::s
for (U32 i = 0; i < count; ++i)
{
LLTextureEntry* te = obj->getTE(i);
- if (te && te->getGLTFMaterialOverride())
+ if (!has_te[i] && te && te->getGLTFMaterialOverride())
{
obj->setTEGLTFMaterialOverride(i, nullptr);
handle_gltf_override_message.doSelectionCallbacks(id, i);