| 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 "codec_int.h" | 8 #include "codec_int.h" |
| 9 CCodec_ModuleMgr::CCodec_ModuleMgr() | 9 CCodec_ModuleMgr::CCodec_ModuleMgr() |
| 10 { | 10 { |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 m_SrcSize = src_size; | 667 m_SrcSize = src_size; |
| 668 m_OutputWidth = m_OrigWidth = width; | 668 m_OutputWidth = m_OrigWidth = width; |
| 669 m_OutputHeight = m_OrigHeight = height; | 669 m_OutputHeight = m_OrigHeight = height; |
| 670 m_nComps = nComps; | 670 m_nComps = nComps; |
| 671 m_bpc = bpc; | 671 m_bpc = bpc; |
| 672 m_bColorTransformed = FALSE; | 672 m_bColorTransformed = FALSE; |
| 673 m_DownScale = 1; | 673 m_DownScale = 1; |
| 674 m_Pitch = (width * nComps * bpc + 31) / 32 * 4; | 674 m_Pitch = (width * nComps * bpc + 31) / 32 * 4; |
| 675 m_dwLineBytes = (width * nComps * bpc + 7) / 8; | 675 m_dwLineBytes = (width * nComps * bpc + 7) / 8; |
| 676 m_pScanline = FX_Alloc(FX_BYTE, m_Pitch); | 676 m_pScanline = FX_Alloc(FX_BYTE, m_Pitch); |
| 677 if (m_pScanline == NULL) { | |
| 678 return FALSE; | |
| 679 } | |
| 680 return CheckDestSize(); | 677 return CheckDestSize(); |
| 681 } | 678 } |
| 682 FX_BOOL CCodec_RLScanlineDecoder::v_Rewind() | 679 FX_BOOL CCodec_RLScanlineDecoder::v_Rewind() |
| 683 { | 680 { |
| 684 FXSYS_memset32(m_pScanline, 0, m_Pitch); | 681 FXSYS_memset32(m_pScanline, 0, m_Pitch); |
| 685 m_SrcOffset = 0; | 682 m_SrcOffset = 0; |
| 686 m_bEOD = FALSE; | 683 m_bEOD = FALSE; |
| 687 m_Operator = 0; | 684 m_Operator = 0; |
| 688 return TRUE; | 685 return TRUE; |
| 689 } | 686 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 ICodec_ScanlineDecoder* CCodec_BasicModule::CreateRunLengthDecoder(FX_LPCBYTE sr
c_buf, FX_DWORD src_size, int width, int height, | 771 ICodec_ScanlineDecoder* CCodec_BasicModule::CreateRunLengthDecoder(FX_LPCBYTE sr
c_buf, FX_DWORD src_size, int width, int height, |
| 775 int nComps, int bpc) | 772 int nComps, int bpc) |
| 776 { | 773 { |
| 777 CCodec_RLScanlineDecoder* pRLScanlineDecoder = new CCodec_RLScanlineDecoder; | 774 CCodec_RLScanlineDecoder* pRLScanlineDecoder = new CCodec_RLScanlineDecoder; |
| 778 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, bp
c)) { | 775 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, bp
c)) { |
| 779 delete pRLScanlineDecoder; | 776 delete pRLScanlineDecoder; |
| 780 return NULL; | 777 return NULL; |
| 781 } | 778 } |
| 782 return pRLScanlineDecoder; | 779 return pRLScanlineDecoder; |
| 783 } | 780 } |
| OLD | NEW |