Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: core/src/fxcodec/codec/fx_codec.cpp

Issue 1143663008: Merge to XFA: Remove FX_Alloc() null checks now that it can't return NULL. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebased. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fpdftext/fpdf_text_int.cpp ('k') | core/src/fxcodec/codec/fx_codec_fax.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « core/src/fpdftext/fpdf_text_int.cpp ('k') | core/src/fxcodec/codec/fx_codec_fax.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698