summaryrefslogtreecommitdiff
path: root/indra/llimage/llimagejpeg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llimage/llimagejpeg.cpp')
-rw-r--r--indra/llimage/llimagejpeg.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp
index dd3efb3459..803d8f17fc 100644
--- a/indra/llimage/llimagejpeg.cpp
+++ b/indra/llimage/llimagejpeg.cpp
@@ -31,7 +31,9 @@
#include "llerror.h"
#include "llexception.h"
+#if !(LL_DARWIN && defined(__arm64__))
jmp_buf LLImageJPEG::sSetjmpBuffer ;
+#endif
LLImageJPEG::LLImageJPEG(S32 quality)
: LLImageFormatted(IMG_CODEC_JPEG),
mOutputBuffer( NULL ),
@@ -435,7 +437,6 @@ void LLImageJPEG::errorExit( j_common_ptr cinfo )
// Let the memory manager delete any temp files
jpeg_destroy(cinfo);
-
// Return control to the setjmp point
#if !(LL_DARWIN && defined(__arm64__))
longjmp(sSetjmpBuffer, 1) ;
@@ -497,6 +498,12 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )
resetLastError();
+ if (raw_image->isBufferInvalid())
+ {
+ setLastError("Invalid input, no buffer");
+ return false;
+ }
+
LLImageDataSharedLock lockIn(raw_image);
LLImageDataLock lockOut(this);
@@ -563,7 +570,6 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )
return false;
}
#endif
-
try
{