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

Side by Side Diff: core/fpdfapi/render/fpdf_render_loadimage.cpp

Issue 2449293002: Fix some bool/int mismatches. (Closed)
Patch Set: 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
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/fpdfapi/render/render_int.h" 7 #include "core/fpdfapi/render/render_int.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 } 544 }
545 const uint8_t* src_data = m_pStreamAcc->GetData(); 545 const uint8_t* src_data = m_pStreamAcc->GetData();
546 uint32_t src_size = m_pStreamAcc->GetSize(); 546 uint32_t src_size = m_pStreamAcc->GetSize();
547 const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam(); 547 const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam();
548 if (decoder == "CCITTFaxDecode") { 548 if (decoder == "CCITTFaxDecode") {
549 m_pDecoder.reset(FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width, 549 m_pDecoder.reset(FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width,
550 m_Height, pParams)); 550 m_Height, pParams));
551 } else if (decoder == "DCTDecode") { 551 } else if (decoder == "DCTDecode") {
552 m_pDecoder.reset(CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder( 552 m_pDecoder.reset(CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
553 src_data, src_size, m_Width, m_Height, m_nComponents, 553 src_data, src_size, m_Width, m_Height, m_nComponents,
554 pParams ? pParams->GetIntegerFor("ColorTransform", 1) : 1)); 554 !pParams || pParams->GetIntegerFor("ColorTransform", 1)));
npm 2016/10/26 14:33:00 Not quite sure why this change will make any diffe
Tom Sepez 2016/10/26 15:45:08 Because in c++ the || operator yields a bool. If
555 if (!m_pDecoder) { 555 if (!m_pDecoder) {
556 bool bTransform = false; 556 bool bTransform = false;
557 int comps; 557 int comps;
558 int bpc; 558 int bpc;
559 CCodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule(); 559 CCodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule();
560 if (pJpegModule->LoadInfo(src_data, src_size, &m_Width, &m_Height, &comps, 560 if (pJpegModule->LoadInfo(src_data, src_size, &m_Width, &m_Height, &comps,
561 &bpc, &bTransform)) { 561 &bpc, &bTransform)) {
562 if (m_nComponents != static_cast<uint32_t>(comps)) { 562 if (m_nComponents != static_cast<uint32_t>(comps)) {
563 FX_Free(m_pCompData); 563 FX_Free(m_pCompData);
564 m_pCompData = nullptr; 564 m_pCompData = nullptr;
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 IFX_Pause* pPause) { 1550 IFX_Pause* pPause) {
1551 return LoadHandle->Continue(pPause); 1551 return LoadHandle->Continue(pPause);
1552 } 1552 }
1553 1553
1554 CPDF_ImageLoader::~CPDF_ImageLoader() { 1554 CPDF_ImageLoader::~CPDF_ImageLoader() {
1555 if (!m_bCached) { 1555 if (!m_bCached) {
1556 delete m_pBitmap; 1556 delete m_pBitmap;
1557 delete m_pMask; 1557 delete m_pMask;
1558 } 1558 }
1559 } 1559 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698