diff options
Diffstat (limited to 'indra/llimage')
| -rw-r--r-- | indra/llimage/llimagejpeg.cpp | 13 | ||||
| -rw-r--r-- | indra/llimage/llimagejpeg.h | 2 | 
2 files changed, 13 insertions, 2 deletions
diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp index effd33b410..ab6c593fc2 100644 --- a/indra/llimage/llimagejpeg.cpp +++ b/indra/llimage/llimagejpeg.cpp @@ -31,7 +31,9 @@  #include "llerror.h"  #include "llexception.h" +#if !LL_ARM64  jmp_buf LLImageJPEG::sSetjmpBuffer ; +#endif  LLImageJPEG::LLImageJPEG(S32 quality)  :   LLImageFormatted(IMG_CODEC_JPEG),      mOutputBuffer( NULL ), @@ -78,12 +80,15 @@ 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 +    //except in the case of AARCH64/ARM64 where setjmp will crash      // +#if !LL_ARM64      if(setjmp(sSetjmpBuffer))      {          jpeg_destroy_decompress(&cinfo);          return false;      } +#endif      try      {          // Now we can initialize the JPEG decompression object. @@ -223,11 +228,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_ARM64      if(setjmp(sSetjmpBuffer))      {          jpeg_destroy_decompress(&cinfo);          return true; // done      } +#endif      try      {          // Now we can initialize the JPEG decompression object. @@ -431,9 +438,10 @@ void LLImageJPEG::errorExit( j_common_ptr cinfo )      // Let the memory manager delete any temp files      jpeg_destroy(cinfo); - +#if !LL_ARM64      // Return control to the setjmp point      longjmp(sSetjmpBuffer, 1) ; +#endif  }  // Decide whether to emit a trace or warning message. @@ -551,6 +559,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_ARM64      if( setjmp(sSetjmpBuffer) )      {          // If we get here, the JPEG code has signaled an error. @@ -561,7 +570,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )          mOutputBufferSize = 0;          return false;      } - +#endif      try      { diff --git a/indra/llimage/llimagejpeg.h b/indra/llimage/llimagejpeg.h index 012b87a42d..ee0a8815e8 100644 --- a/indra/llimage/llimagejpeg.h +++ b/indra/llimage/llimagejpeg.h @@ -78,7 +78,9 @@ protected:      S32             mEncodeQuality;     // on a scale from 1 to 100  private: +#if !LL_ARM64      static jmp_buf  sSetjmpBuffer;      // To allow the library to abort. +#endif  };  #endif  // LL_LLIMAGEJPEG_H  | 
