00001 #include <stdio.h> 00002 #include <stdlib.h> 00003 #include "jpegwrapper.h" 00004 #include <png.h> // Need setjmp.h included by png.h 00005 00006 // Handle JPEG error conditions 00007 struct bcast_error_mgr { 00008 struct jpeg_error_mgr pub; /* "public" fields */ 00009 00010 jmp_buf setjmp_buffer; /* for return to caller */ 00011 }; 00012 00013 typedef struct bcast_error_mgr* bcast_error_ptr; 00014 00015 METHODDEF(void) 00016 bcast_error_exit (j_common_ptr cinfo) 00017 { 00018 /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */ 00019 bcast_error_ptr myerr = (bcast_error_ptr) cinfo->err; 00020 00021 /* Always display the message. */ 00022 /* We could postpone this until after returning, if we chose. */ 00023 (*cinfo->err->output_message) (cinfo); 00024 00025 /* Return control to the setjmp point */ 00026 longjmp(myerr->setjmp_buffer, 1); 00027 }
1.4.4