summaryrefslogtreecommitdiff
path: root/indra/newview/llgltfmateriallist.cpp
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-09-09 15:35:32 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-09-09 15:35:32 -0700
commite488c87532ad9e8cc0e6d34ecf647fe719f2ba6a (patch)
tree68d3adaf448b9f895675a981ca833d4aa8e771ad /indra/newview/llgltfmateriallist.cpp
parentcb902bf9a97177322c222a032715262987c98eb9 (diff)
parent765a99d238da80bcf705f58f8e8d6082050c0260 (diff)
Merge branch 'DRTVWR-559' of bitbucket.org:lindenlab/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview/llgltfmateriallist.cpp')
-rw-r--r--indra/newview/llgltfmateriallist.cpp9
1 files changed, 8 insertions, 1 deletions
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;