src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c

Print this page
rev 9959 : 8026385: [macosx] (awt) setjmp/longjmp changes the process signal mask on OS X
Reviewed-by:
Contributed-by: David DeHaven <david.dehaven@oracle.com>


  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #include "splashscreen_impl.h"
  27 
  28 #include "jpeglib.h"
  29 #include "jerror.h"
  30 
  31 #include <setjmp.h>
  32 






  33 /* stream input handling */
  34 
  35 typedef struct
  36 {
  37     struct jpeg_source_mgr pub; /* public fields */
  38     SplashStream * stream;      /* source stream */
  39     JOCTET *buffer;             /* start of buffer */
  40     boolean start_of_file;      /* have we gotten any data yet? */
  41 } stream_source_mgr;
  42 
  43 typedef stream_source_mgr *stream_src_ptr;
  44 
  45 #define INPUT_BUF_SIZE  4096    /* choose an efficiently fread'able size */
  46 
  47 METHODDEF(void)
  48 stream_init_source(j_decompress_ptr cinfo)
  49 {
  50     stream_src_ptr src = (stream_src_ptr) cinfo->src;
  51 
  52     src->start_of_file = TRUE;




  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #include "splashscreen_impl.h"
  27 
  28 #include "jpeglib.h"
  29 #include "jerror.h"
  30 
  31 #include <setjmp.h>
  32 
  33 #ifdef __APPLE__
  34 /* use setjmp/longjmp versions that do not save/restore the signal mask */
  35 #define setjmp _setjmp
  36 #define longjmp _longjmp
  37 #endif
  38 
  39 /* stream input handling */
  40 
  41 typedef struct
  42 {
  43     struct jpeg_source_mgr pub; /* public fields */
  44     SplashStream * stream;      /* source stream */
  45     JOCTET *buffer;             /* start of buffer */
  46     boolean start_of_file;      /* have we gotten any data yet? */
  47 } stream_source_mgr;
  48 
  49 typedef stream_source_mgr *stream_src_ptr;
  50 
  51 #define INPUT_BUF_SIZE  4096    /* choose an efficiently fread'able size */
  52 
  53 METHODDEF(void)
  54 stream_init_source(j_decompress_ptr cinfo)
  55 {
  56     stream_src_ptr src = (stream_src_ptr) cinfo->src;
  57 
  58     src->start_of_file = TRUE;