OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../../include/fxcodec/fx_codec.h" | 7 #include "../../../include/fxcodec/fx_codec.h" |
8 #include "../../../include/fxge/fx_dib.h" | 8 #include "../../../include/fxge/fx_dib.h" |
9 #include "codec_int.h" | 9 #include "codec_int.h" |
10 extern "C" { | 10 extern "C" { |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length) | 275 FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length) |
276 { | 276 { |
277 _JpegScanSOI(src_buf, src_size); | 277 _JpegScanSOI(src_buf, src_size); |
278 struct jpeg_decompress_struct cinfo; | 278 struct jpeg_decompress_struct cinfo; |
279 struct jpeg_error_mgr jerr; | 279 struct jpeg_error_mgr jerr; |
280 jerr.error_exit = _error_fatal; | 280 jerr.error_exit = _error_fatal; |
281 jerr.emit_message = _error_do_nothing1; | 281 jerr.emit_message = _error_do_nothing1; |
282 jerr.output_message = _error_do_nothing; | 282 jerr.output_message = _error_do_nothing; |
283 jerr.format_message = _error_do_nothing2; | 283 jerr.format_message = _error_do_nothing2; |
284 jerr.reset_error_mgr = _error_do_nothing; | 284 jerr.reset_error_mgr = _error_do_nothing; |
| 285 jerr.trace_level = 0; |
285 cinfo.err = &jerr; | 286 cinfo.err = &jerr; |
286 jmp_buf mark; | 287 jmp_buf mark; |
287 cinfo.client_data = &mark; | 288 cinfo.client_data = &mark; |
288 if (setjmp(mark) == -1) { | 289 if (setjmp(mark) == -1) { |
289 return FALSE; | 290 return FALSE; |
290 } | 291 } |
291 jpeg_create_decompress(&cinfo); | 292 jpeg_create_decompress(&cinfo); |
292 struct jpeg_source_mgr src; | 293 struct jpeg_source_mgr src; |
293 src.init_source = _src_do_nothing; | 294 src.init_source = _src_do_nothing; |
294 src.term_source = _src_do_nothing; | 295 src.term_source = _src_do_nothing; |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 return m_pExtProvider->GetAvailInput(pContext, avail_buf_ptr); | 727 return m_pExtProvider->GetAvailInput(pContext, avail_buf_ptr); |
727 } | 728 } |
728 if(avail_buf_ptr != NULL) { | 729 if(avail_buf_ptr != NULL) { |
729 *avail_buf_ptr = NULL; | 730 *avail_buf_ptr = NULL; |
730 if(((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer > 0) { | 731 if(((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer > 0) { |
731 *avail_buf_ptr = (FX_LPBYTE)((FXJPEG_Context*)pContext)->m_SrcMgr.ne
xt_input_byte; | 732 *avail_buf_ptr = (FX_LPBYTE)((FXJPEG_Context*)pContext)->m_SrcMgr.ne
xt_input_byte; |
732 } | 733 } |
733 } | 734 } |
734 return (FX_DWORD)((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer; | 735 return (FX_DWORD)((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer; |
735 } | 736 } |
OLD | NEW |