summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-02 15:39:19 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-02 15:39:19 +0800
commite5c159597f159c308df878d053b591783337a3a1 (patch)
tree2b202ec6223bc8f1f62fe86eb70d3302e90ed4e4 /indra/llimage
parent0fe0f1cfbba94913cb2ed48e47af509c81096d2b (diff)
parent631e50e18719c52970c788dd70c19bd14e0d3a54 (diff)
Merge branch 'main' into 2024.06-atlasaurus
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimagejpeg.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp
index 0e7ec365d4..dd3efb3459 100644
--- a/indra/llimage/llimagejpeg.cpp
+++ b/indra/llimage/llimagejpeg.cpp
@@ -79,11 +79,13 @@ bool LLImageJPEG::updateData()
//try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error
//so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao
//
+#if !(LL_DARWIN && defined(__arm64__))
if(setjmp(sSetjmpBuffer))
{
jpeg_destroy_decompress(&cinfo);
return false;
}
+#endif
try
{
// Now we can initialize the JPEG decompression object.
@@ -223,11 +225,13 @@ bool LLImageJPEG::decode(LLImageRaw* raw_image, F32 decode_time)
//try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error
//so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao
//
+#if !(LL_DARWIN && defined(__arm64__))
if(setjmp(sSetjmpBuffer))
{
jpeg_destroy_decompress(&cinfo);
return true; // done
}
+#endif
try
{
// Now we can initialize the JPEG decompression object.
@@ -433,7 +437,9 @@ void LLImageJPEG::errorExit( j_common_ptr cinfo )
jpeg_destroy(cinfo);
// Return control to the setjmp point
+#if !(LL_DARWIN && defined(__arm64__))
longjmp(sSetjmpBuffer, 1) ;
+#endif
}
// Decide whether to emit a trace or warning message.
@@ -545,6 +551,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )
//try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error
//so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao
//
+#if !(LL_DARWIN && defined(__arm64__))
if( setjmp(sSetjmpBuffer) )
{
// If we get here, the JPEG code has signaled an error.
@@ -555,6 +562,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )
mOutputBufferSize = 0;
return false;
}
+#endif
try
{