diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-12-15 19:41:34 +0200 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-12-15 19:41:34 +0200 |
commit | 5b60199bb08b70dde89bade04c1cb00a3361945e (patch) | |
tree | 97f402f0f053e298782f10f186aca7fce29f37cc /indra/newview/llmeshrepository.cpp | |
parent | efeab1d5b5146000b535bb68ad14e82ab8867c1b (diff) |
MAINT-8064 Crashes in lodReceived()
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rw-r--r-- | indra/newview/llmeshrepository.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 29a4ad001a..25bd0d855e 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1727,8 +1727,17 @@ bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U } LLPointer<LLVolume> volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod)); - std::string mesh_string((char*) data, data_size); - std::istringstream stream(mesh_string); + std::istringstream stream; + try + { + std::string mesh_string((char*)data, data_size); + stream.str(mesh_string); + } + catch (std::bad_alloc) + { + // out of memory, we won't be able to process this mesh + return false; + } if (volume->unpackVolumeFaces(stream, data_size)) { |