diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-04-14 07:36:13 -0500 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2023-04-14 07:36:13 -0500 |
commit | d32bca67f17b978387ece4d9b220fc7b4d74a89b (patch) | |
tree | 013d97354d4a4aac765b361a8bcb588f6cc68fc6 /indra/newview/llviewerobject.cpp | |
parent | 5f5bac8087973be7da1d9b78a080463b816a1efc (diff) |
DRTVWR-559 Add paranoia checks around typecasts of LLGLTFMaterial to LLFetchedGLTFMaterial
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r-- | indra/newview/llviewerobject.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e641ac4215..100c73377f 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4957,10 +4957,12 @@ void LLViewerObject::updateTEMaterialTextures(U8 te) } LLFetchedGLTFMaterial* mat = (LLFetchedGLTFMaterial*) getTE(te)->getGLTFRenderMaterial(); + llassert(mat == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(getTE(te)->getGLTFRenderMaterial()) != nullptr); LLUUID mat_id = getRenderMaterialID(te); if (mat == nullptr && mat_id.notNull()) { mat = (LLFetchedGLTFMaterial*) gGLTFMaterialList.getMaterial(mat_id); + llassert(mat == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(gGLTFMaterialList.getMaterial(mat_id)) != nullptr); if (mat->isFetching()) { // material is not loaded yet, rebuild draw info when the object finishes loading mat->onMaterialComplete([id=getID()] @@ -5383,7 +5385,7 @@ S32 LLViewerObject::setTEGLTFMaterialOverride(U8 te, LLGLTFMaterial* override_ma } LLFetchedGLTFMaterial* src_mat = (LLFetchedGLTFMaterial*) tep->getGLTFMaterial(); - + llassert(src_mat == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(tep->getGLTFMaterial()) != nullptr); // if override mat exists, we must also have a source mat if (!src_mat) { |