diff options
author | Oz Linden <oz@lindenlab.com> | 2017-08-23 09:19:59 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2017-08-23 09:19:59 -0400 |
commit | bcf5dc079a5dc9434b541a971e28315fa5cb9816 (patch) | |
tree | 16f6b186d704ca9682bcbfcb8aca1e29ef85b103 /indra/newview/llmeshrepository.cpp | |
parent | fa53653e60f5761c157b76423b4449fe38788d8f (diff) | |
parent | 08cbed55ef5689fcc5a02dfb3b9afde15487036e (diff) |
merge changes for 5.0.7-release
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rw-r--r-- | indra/newview/llmeshrepository.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index c4d1917567..c2a0393170 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1586,7 +1586,12 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod) LLMeshRepository::sCacheBytesRead += size; ++LLMeshRepository::sCacheReads; file.seek(offset); - U8* buffer = new U8[size]; + U8* buffer = new(std::nothrow) U8[size]; + if (!buffer) + { + LL_WARNS(LOG_MESH) << "Can't allocate memory for mesh LOD" << LL_ENDL; + return false; + } file.read(buffer, size); //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) |