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

Side by Side Diff: core/fxcodec/codec/fx_codec_fax.cpp

Issue 2032613003: Get rid of NULLs in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Fix a bad merge Created 4 years, 6 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/fxcodec/codec/fx_codec_bmp.cpp ('k') | core/fxcodec/codec/fx_codec_flate.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 "core/fxcodec/codec/codec_int.h" 7 #include "core/fxcodec/codec/codec_int.h"
8 #include "core/fxcodec/include/fx_codec.h" 8 #include "core/fxcodec/include/fx_codec.h"
9 9
10 namespace { 10 namespace {
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 530
531 FX_BOOL CCodec_FaxDecoder::v_Rewind() { 531 FX_BOOL CCodec_FaxDecoder::v_Rewind() {
532 FXSYS_memset(m_pRefBuf, 0xff, m_Pitch); 532 FXSYS_memset(m_pRefBuf, 0xff, m_Pitch);
533 bitpos = 0; 533 bitpos = 0;
534 return TRUE; 534 return TRUE;
535 } 535 }
536 uint8_t* CCodec_FaxDecoder::v_GetNextLine() { 536 uint8_t* CCodec_FaxDecoder::v_GetNextLine() {
537 int bitsize = m_SrcSize * 8; 537 int bitsize = m_SrcSize * 8;
538 FaxSkipEOL(m_pSrcBuf, bitsize, bitpos); 538 FaxSkipEOL(m_pSrcBuf, bitsize, bitpos);
539 if (bitpos >= bitsize) { 539 if (bitpos >= bitsize) {
540 return NULL; 540 return nullptr;
541 } 541 }
542 FXSYS_memset(m_pScanlineBuf, 0xff, m_Pitch); 542 FXSYS_memset(m_pScanlineBuf, 0xff, m_Pitch);
543 if (m_Encoding < 0) { 543 if (m_Encoding < 0) {
544 FaxG4GetRow(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, 544 FaxG4GetRow(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf,
545 m_OrigWidth); 545 m_OrigWidth);
546 FXSYS_memcpy(m_pRefBuf, m_pScanlineBuf, m_Pitch); 546 FXSYS_memcpy(m_pRefBuf, m_pScanlineBuf, m_Pitch);
547 } else if (m_Encoding == 0) { 547 } else if (m_Encoding == 0) {
548 FaxGet1DLine(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_OrigWidth); 548 FaxGet1DLine(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_OrigWidth);
549 } else { 549 } else {
550 FX_BOOL bNext1D = m_pSrcBuf[bitpos / 8] & (1 << (7 - bitpos % 8)); 550 FX_BOOL bNext1D = m_pSrcBuf[bitpos / 8] & (1 << (7 - bitpos % 8));
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 int height, 620 int height,
621 int K, 621 int K,
622 FX_BOOL EndOfLine, 622 FX_BOOL EndOfLine,
623 FX_BOOL EncodedByteAlign, 623 FX_BOOL EncodedByteAlign,
624 FX_BOOL BlackIs1, 624 FX_BOOL BlackIs1,
625 int Columns, 625 int Columns,
626 int Rows) { 626 int Rows) {
627 return new CCodec_FaxDecoder(src_buf, src_size, width, height, K, EndOfLine, 627 return new CCodec_FaxDecoder(src_buf, src_size, width, height, K, EndOfLine,
628 EncodedByteAlign, BlackIs1, Columns, Rows); 628 EncodedByteAlign, BlackIs1, Columns, Rows);
629 } 629 }
OLDNEW
« no previous file with comments | « core/fxcodec/codec/fx_codec_bmp.cpp ('k') | core/fxcodec/codec/fx_codec_flate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698