From e24d4c9f4d2f37ee80685c6ab276633b94b366b8 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 26 Jul 2018 20:06:26 +0300 Subject: MAINT-8923 Better allocation failure handling, createGLTexture crashes --- indra/llcharacter/llkeyframemotion.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/llcharacter/llkeyframemotion.cpp') 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; } -- cgit v1.2.3