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

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

Issue 2459673002: Fix some FX_BOOL / int noise in core/fx* (Closed)
Patch Set: Fix some FX_BOOL / int noise in core/fx* Created 4 years, 1 month 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 | « no previous file | core/fxge/agg/fx_agg_driver.cpp » ('j') | core/fxge/agg/fx_agg_driver.cpp » ('J')
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 <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "core/fxcodec/codec/codec_int.h" 10 #include "core/fxcodec/codec/codec_int.h"
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 return nullptr; 515 return nullptr;
516 516
517 FXSYS_memset(m_ScanlineBuf.data(), 0xff, m_ScanlineBuf.size()); 517 FXSYS_memset(m_ScanlineBuf.data(), 0xff, m_ScanlineBuf.size());
518 if (m_Encoding < 0) { 518 if (m_Encoding < 0) {
519 FaxG4GetRow(m_pSrcBuf, bitsize, &m_bitpos, m_ScanlineBuf.data(), m_RefBuf, 519 FaxG4GetRow(m_pSrcBuf, bitsize, &m_bitpos, m_ScanlineBuf.data(), m_RefBuf,
520 m_OrigWidth); 520 m_OrigWidth);
521 m_RefBuf = m_ScanlineBuf; 521 m_RefBuf = m_ScanlineBuf;
522 } else if (m_Encoding == 0) { 522 } else if (m_Encoding == 0) {
523 FaxGet1DLine(m_pSrcBuf, bitsize, &m_bitpos, &m_ScanlineBuf, m_OrigWidth); 523 FaxGet1DLine(m_pSrcBuf, bitsize, &m_bitpos, &m_ScanlineBuf, m_OrigWidth);
524 } else { 524 } else {
525 FX_BOOL bNext1D = m_pSrcBuf[m_bitpos / 8] & (1 << (7 - m_bitpos % 8)); 525 if (NextBit(m_pSrcBuf, &m_bitpos)) {
526 ++m_bitpos;
527 if (bNext1D) {
528 FaxGet1DLine(m_pSrcBuf, bitsize, &m_bitpos, &m_ScanlineBuf, m_OrigWidth); 526 FaxGet1DLine(m_pSrcBuf, bitsize, &m_bitpos, &m_ScanlineBuf, m_OrigWidth);
529 } else { 527 } else {
530 FaxG4GetRow(m_pSrcBuf, bitsize, &m_bitpos, m_ScanlineBuf.data(), m_RefBuf, 528 FaxG4GetRow(m_pSrcBuf, bitsize, &m_bitpos, m_ScanlineBuf.data(), m_RefBuf,
531 m_OrigWidth); 529 m_OrigWidth);
532 } 530 }
533 m_RefBuf = m_ScanlineBuf; 531 m_RefBuf = m_ScanlineBuf;
534 } 532 }
535 if (m_bEndOfLine) 533 if (m_bEndOfLine)
536 FaxSkipEOL(m_pSrcBuf, bitsize, &m_bitpos); 534 FaxSkipEOL(m_pSrcBuf, bitsize, &m_bitpos);
537 535
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 return nullptr; 598 return nullptr;
601 599
602 // Reject unreasonable large input. 600 // Reject unreasonable large input.
603 if (actual_width > kMaxImageDimension || actual_height > kMaxImageDimension) 601 if (actual_width > kMaxImageDimension || actual_height > kMaxImageDimension)
604 return nullptr; 602 return nullptr;
605 603
606 uint32_t pitch = (static_cast<uint32_t>(actual_width) + 31) / 32 * 4; 604 uint32_t pitch = (static_cast<uint32_t>(actual_width) + 31) / 32 * 4;
607 return new CCodec_FaxDecoder(src_buf, src_size, actual_width, actual_height, 605 return new CCodec_FaxDecoder(src_buf, src_size, actual_width, actual_height,
608 pitch, K, EndOfLine, EncodedByteAlign, BlackIs1); 606 pitch, K, EndOfLine, EncodedByteAlign, BlackIs1);
609 } 607 }
OLDNEW
« no previous file with comments | « no previous file | core/fxge/agg/fx_agg_driver.cpp » ('j') | core/fxge/agg/fx_agg_driver.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698