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

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

Issue 1377943002: Merge to M46: Fix blank page issue caused by too strict correction on bpc (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@2490
Patch Set: Created 5 years, 2 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 | « no previous file | testing/resources/pixel/bug_512557.in » ('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 "../../../../third_party/base/nonstd_unique_ptr.h" 7 #include "../../../../third_party/base/nonstd_unique_ptr.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../../../include/fpdfapi/fpdf_pageobj.h" 9 #include "../../../include/fpdfapi/fpdf_pageobj.h"
10 #include "../../../include/fpdfapi/fpdf_render.h" 10 #include "../../../include/fpdfapi/fpdf_render.h"
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 m_bpc = m_bpc_orig; 958 m_bpc = m_bpc_orig;
959 CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter")); 959 CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter"));
960 if (pFilter) { 960 if (pFilter) {
961 if (pFilter->GetType() == PDFOBJ_NAME) { 961 if (pFilter->GetType() == PDFOBJ_NAME) {
962 CFX_ByteString filter = pFilter->GetString(); 962 CFX_ByteString filter = pFilter->GetString();
963 if (filter == FX_BSTRC("CCITTFaxDecode") || 963 if (filter == FX_BSTRC("CCITTFaxDecode") ||
964 filter == FX_BSTRC("JBIG2Decode")) { 964 filter == FX_BSTRC("JBIG2Decode")) {
965 m_bpc = 1; 965 m_bpc = 1;
966 m_nComponents = 1; 966 m_nComponents = 1;
967 } 967 }
968 if (filter == FX_BSTRC("RunLengthDecode") || 968 if (filter == FX_BSTRC("RunLengthDecode")) {
969 filter == FX_BSTRC("DCTDecode")) { 969 if (m_bpc != 1) {
970 m_bpc = 8;
971 }
972 } else if (filter == FX_BSTRC("DCTDecode")) {
970 m_bpc = 8; 973 m_bpc = 8;
971 } 974 }
972 } else if (pFilter->GetType() == PDFOBJ_ARRAY) { 975 } else if (pFilter->GetType() == PDFOBJ_ARRAY) {
973 CPDF_Array* pArray = (CPDF_Array*)pFilter; 976 CPDF_Array* pArray = (CPDF_Array*)pFilter;
974 if (pArray->GetString(pArray->GetCount() - 1) == 977 if (pArray->GetString(pArray->GetCount() - 1) ==
975 FX_BSTRC("CCITTFaxDecode") || 978 FX_BSTRC("CCITTFaxDecode") ||
976 pArray->GetString(pArray->GetCount() - 1) == 979 pArray->GetString(pArray->GetCount() - 1) ==
977 FX_BSTRC("JBIG2Decode")) { 980 FX_BSTRC("JBIG2Decode")) {
978 m_bpc = 1; 981 m_bpc = 1;
979 m_nComponents = 1; 982 m_nComponents = 1;
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 } 1642 }
1640 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { 1643 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) {
1641 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); 1644 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause);
1642 } 1645 }
1643 CPDF_ImageLoader::~CPDF_ImageLoader() { 1646 CPDF_ImageLoader::~CPDF_ImageLoader() {
1644 if (!m_bCached) { 1647 if (!m_bCached) {
1645 delete m_pBitmap; 1648 delete m_pBitmap;
1646 delete m_pMask; 1649 delete m_pMask;
1647 } 1650 }
1648 } 1651 }
OLDNEW
« no previous file with comments | « no previous file | testing/resources/pixel/bug_512557.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698