summaryrefslogtreecommitdiff
path: root/indra/newview/llmeshrepository.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2017-07-28 21:31:59 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2017-07-28 21:31:59 +0300
commitb8fe2d91c72e150f01ecd2d1db265f5b82fb3aab (patch)
tree3311fb0327592119e5c8343356567d0bf7aee3c7 /indra/newview/llmeshrepository.cpp
parent677e040a49db4327ba54ce32c18fedffcc121d96 (diff)
parent7e746e9221bf90466644999364b3c3cc16c0af98 (diff)
Merged in lindenlab/viewer-lynx
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rw-r--r--indra/newview/llmeshrepository.cpp7
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)