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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 m_SrcSize = src_size; | 326 m_SrcSize = src_size; |
327 m_OutputWidth = m_OrigWidth = width; | 327 m_OutputWidth = m_OrigWidth = width; |
328 m_OutputHeight = m_OrigHeight = height; | 328 m_OutputHeight = m_OrigHeight = height; |
329 m_nComps = nComps; | 329 m_nComps = nComps; |
330 m_bpc = bpc; | 330 m_bpc = bpc; |
331 m_bColorTransformed = FALSE; | 331 m_bColorTransformed = FALSE; |
332 m_DownScale = 1; | 332 m_DownScale = 1; |
333 m_Pitch = (width * nComps * bpc + 31) / 32 * 4; | 333 m_Pitch = (width * nComps * bpc + 31) / 32 * 4; |
334 m_dwLineBytes = (width * nComps * bpc + 7) / 8; | 334 m_dwLineBytes = (width * nComps * bpc + 7) / 8; |
335 m_pScanline = FX_Alloc(FX_BYTE, m_Pitch); | 335 m_pScanline = FX_Alloc(FX_BYTE, m_Pitch); |
| 336 if (m_pScanline == NULL) { |
| 337 return FALSE; |
| 338 } |
336 return CheckDestSize(); | 339 return CheckDestSize(); |
337 } | 340 } |
338 FX_BOOL CCodec_RLScanlineDecoder::v_Rewind() | 341 FX_BOOL CCodec_RLScanlineDecoder::v_Rewind() |
339 { | 342 { |
340 FXSYS_memset32(m_pScanline, 0, m_Pitch); | 343 FXSYS_memset32(m_pScanline, 0, m_Pitch); |
341 m_SrcOffset = 0; | 344 m_SrcOffset = 0; |
342 m_bEOD = FALSE; | 345 m_bEOD = FALSE; |
343 m_Operator = 0; | 346 m_Operator = 0; |
344 return TRUE; | 347 return TRUE; |
345 } | 348 } |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 ICodec_ScanlineDecoder* CCodec_BasicModule::CreateRunLengthDecoder(FX_LPCBYTE sr
c_buf, FX_DWORD src_size, int width, int height, | 433 ICodec_ScanlineDecoder* CCodec_BasicModule::CreateRunLengthDecoder(FX_LPCBYTE sr
c_buf, FX_DWORD src_size, int width, int height, |
431 int nComps, int bpc) | 434 int nComps, int bpc) |
432 { | 435 { |
433 CCodec_RLScanlineDecoder* pRLScanlineDecoder = new CCodec_RLScanlineDecoder; | 436 CCodec_RLScanlineDecoder* pRLScanlineDecoder = new CCodec_RLScanlineDecoder; |
434 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, bp
c)) { | 437 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, bp
c)) { |
435 delete pRLScanlineDecoder; | 438 delete pRLScanlineDecoder; |
436 return NULL; | 439 return NULL; |
437 } | 440 } |
438 return pRLScanlineDecoder; | 441 return pRLScanlineDecoder; |
439 } | 442 } |
OLD | NEW |