diff options
author | cosmic-linden <111533034+cosmic-linden@users.noreply.github.com> | 2023-01-23 10:44:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-23 10:44:18 -0800 |
commit | 51d89480fe8c648bd5bf532e9f0f9788299034c2 (patch) | |
tree | cb37d733ecbe763895a5c81191befc2a85b240ba /indra/newview/llgltfmateriallist.cpp | |
parent | 8bad6ccde406566cd6859db69c45c06eb6001386 (diff) | |
parent | a3f43b4b73cc8fbd48a0574ebd74bbe660f8af50 (diff) |
Merge pull request #55 from secondlife/andreyk/SL-19014
SL-19014 Sanitize the override data sent for faces without GLTF materials
Diffstat (limited to 'indra/newview/llgltfmateriallist.cpp')
-rw-r--r-- | indra/newview/llgltfmateriallist.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 9399342a61..4cf1562042 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -392,15 +392,18 @@ void LLGLTFMaterialList::applyQueuedOverrides(LLViewerObject* obj) } } -void LLGLTFMaterialList::queueModify(const LLUUID& id, S32 side, const LLGLTFMaterial* mat) +void LLGLTFMaterialList::queueModify(const LLViewerObject* obj, S32 side, const LLGLTFMaterial* mat) { - if (mat == nullptr) + if (obj && obj->getRenderMaterialID(side).notNull()) { - sModifyQueue.push_back({ id, side, LLGLTFMaterial(), false }); - } - else - { - sModifyQueue.push_back({ id, side, *mat, true}); + if (mat == nullptr) + { + sModifyQueue.push_back({ obj->getID(), side, LLGLTFMaterial(), false }); + } + else + { + sModifyQueue.push_back({ obj->getID(), side, *mat, true }); + } } } @@ -437,8 +440,14 @@ void LLGLTFMaterialList::flushUpdates(void(*done_callback)(bool)) S32 i = data.size(); - for (auto& e : sModifyQueue) + for (ModifyMaterialData& e : sModifyQueue) { +#ifdef SHOW_ASSERT + // validate object has a material id + LLViewerObject* obj = gObjectList.findObject(e.object_id); + llassert(obj && obj->getRenderMaterialID(e.side).notNull()); +#endif + data[i]["object_id"] = e.object_id; data[i]["side"] = e.side; |