From d406a086bace7ab2211981a1115238da76c3654a Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 27 Jul 2018 19:42:08 +0300 Subject: MAINT-8923 Better allocation failure handling --- indra/llimage/llimagejpeg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp index 5c8b63a493..3b1b060c02 100644 --- a/indra/llimage/llimagejpeg.cpp +++ b/indra/llimage/llimagejpeg.cpp @@ -29,6 +29,7 @@ #include "llimagejpeg.h" #include "llerror.h" +#include "llexception.h" jmp_buf LLImageJPEG::sSetjmpBuffer ; LLImageJPEG::LLImageJPEG(S32 quality) @@ -383,7 +384,8 @@ boolean LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo ) U8* new_buffer = new(std::nothrow) U8[ new_buffer_size ]; if (!new_buffer) { - LL_ERRS() << "Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )" << LL_ENDL; + self->setLastError("Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )"); + LLTHROW(LLContinueError("Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )")); return false; } memcpy( new_buffer, self->mOutputBuffer, self->mOutputBufferSize ); /* Flawfinder: ignore */ -- cgit v1.2.3