diff options
author | Dave Parks <davep@lindenlab.com> | 2022-09-02 19:54:25 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-09-02 19:54:25 -0500 |
commit | 4c2b80fd00c545cf2e288520c8cf5fa1379d75b4 (patch) | |
tree | 337da8dd7dcdbbd56357b3b99f3a5013c79baa53 /indra/newview | |
parent | 00b1fec9601c3618f12cebce551e4ce2b38d7e00 (diff) | |
parent | a6c385a8cbcd6083ce28277fc263f7140c9df5cd (diff) |
Merge branch 'SL-17967' of ssh://bitbucket.org/lindenlab/viewer into SL-17967
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfeaturemanager.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llgltfmateriallist.cpp | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index e934041e2e..826d4892ef 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -607,7 +607,7 @@ void LLFeatureManager::applyFeatures(bool skipFeatures) void LLFeatureManager::setGraphicsLevel(U32 level, bool skipFeatures) { LLViewerShaderMgr::sSkipReload = true; - + flush_glerror(); // Whatever may have already happened (e.g., to cause us to change), don't let confuse it with new initializations. applyBaseMasks(); // if we're passed an invalid level, default to "Low" diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index af00cdd05f..b2d223a3e8 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -56,9 +56,16 @@ LLGLTFMaterial* LLGLTFMaterialList::getMaterial(const LLUUID& id) } LLFileSystem file(id, asset_type, LLFileSystem::READ); + auto size = file.getSize(); + if (!size) + { + LL_DEBUGS() << "Zero size material." << LL_ENDL; + mat->unref(); + return; + } std::vector<char> buffer; - buffer.resize(file.getSize()); + buffer.resize(size); file.read((U8*)&buffer[0], buffer.size()); LLSD asset; |