diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2018-07-26 20:06:26 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2018-07-26 20:06:26 +0300 |
commit | e24d4c9f4d2f37ee80685c6ab276633b94b366b8 (patch) | |
tree | d78c2549bb124973e87cce4f53273fd7a2e01687 /indra/llcharacter/llkeyframemotion.cpp | |
parent | 8c8a44f430cc373d3a09308c5efdc420c1571d11 (diff) |
MAINT-8923 Better allocation failure handling, createGLTexture crashes
Diffstat (limited to 'indra/llcharacter/llkeyframemotion.cpp')
-rw-r--r-- | indra/llcharacter/llkeyframemotion.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index f12c64023a..330d812985 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -579,8 +579,15 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact else { anim_file_size = anim_file->getSize(); - anim_data = new U8[anim_file_size]; - success = anim_file->read(anim_data, anim_file_size); /*Flawfinder: ignore*/ + anim_data = new(std::nothrow) U8[anim_file_size]; + if (anim_data) + { + success = anim_file->read(anim_data, anim_file_size); /*Flawfinder: ignore*/ + } + else + { + LL_WARNS() << "Failed to allocate buffer: " << anim_file_size << mID << LL_ENDL; + } delete anim_file; anim_file = NULL; } |