From 013a7130011f72ab0c124dba87376b9862a95461 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Fri, 2 Sep 2022 15:44:19 -0700 Subject: SL-17967 - slightly more meaningful ogl error reporting --- indra/newview/llfeaturemanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') 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" -- cgit v1.2.3 From cf8e1b2ac4614c0b4f8211f980214f5e823a672c Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Fri, 2 Sep 2022 16:01:38 -0700 Subject: SL-17967 - do not crash on zero-sized materials --- indra/newview/llgltfmateriallist.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview') 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 buffer; - buffer.resize(file.getSize()); + buffer.resize(size); file.read((U8*)&buffer[0], buffer.size()); LLSD asset; -- cgit v1.2.3