Ticket #3116: jpeg-io_error-exception.patch
File jpeg-io_error-exception.patch, 751 bytes (added by , 13 years ago) |
---|
-
boost/gil/extension/io/jpeg_io_private.hpp
old new 86 86 87 87 void init() { 88 88 _cinfo.err=jpeg_std_error(&_jerr); 89 _cinfo.err->error_exit = error_exit; 89 90 jpeg_create_decompress(&_cinfo); 90 91 jpeg_stdio_src(&_cinfo,_fp.get()); 91 92 jpeg_read_header(&_cinfo,TRUE); 92 93 } 94 95 static void error_exit(j_common_ptr cinfo) 96 { 97 char buffer[JMSG_LENGTH_MAX]; 98 /* Create the message */ 99 (*cinfo->err->format_message) (cinfo, buffer); 100 101 io_error(buffer); 102 } 93 103 public: 94 104 jpeg_reader(FILE* file) : file_mgr(file) { init(); } 95 105 jpeg_reader(const char* filename) : file_mgr(filename, "rb") { init(); }