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

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

Issue 1549043003: Fix failed JPX image rendering (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 12 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/include/fxcodec/fx_codec.h ('k') | core/src/fxcodec/codec/codec_int.h » ('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 "render_int.h" 7 #include "render_int.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 } 677 }
678 return 1; 678 return 1;
679 } 679 }
680 void CPDF_DIBSource::LoadJpxBitmap() { 680 void CPDF_DIBSource::LoadJpxBitmap() {
681 ICodec_JpxModule* pJpxModule = CPDF_ModuleMgr::Get()->GetJpxModule(); 681 ICodec_JpxModule* pJpxModule = CPDF_ModuleMgr::Get()->GetJpxModule();
682 if (!pJpxModule) 682 if (!pJpxModule)
683 return; 683 return;
684 684
685 nonstd::unique_ptr<JpxBitMapContext> context( 685 nonstd::unique_ptr<JpxBitMapContext> context(
686 new JpxBitMapContext(pJpxModule)); 686 new JpxBitMapContext(pJpxModule));
687 context->set_decoder(pJpxModule->CreateDecoder(m_pStreamAcc->GetData(), 687 context->set_decoder(pJpxModule->CreateDecoder(
688 m_pStreamAcc->GetSize(), 688 m_pStreamAcc->GetData(), m_pStreamAcc->GetSize(), m_pColorSpace));
689 m_pColorSpace == nullptr));
690 if (!context->decoder()) 689 if (!context->decoder())
691 return; 690 return;
692 691
693 FX_DWORD width = 0; 692 FX_DWORD width = 0;
694 FX_DWORD height = 0; 693 FX_DWORD height = 0;
695 FX_DWORD components = 0; 694 FX_DWORD components = 0;
696 pJpxModule->GetImageInfo(context->decoder(), &width, &height, &components); 695 pJpxModule->GetImageInfo(context->decoder(), &width, &height, &components);
697 if ((int)width < m_Width || (int)height < m_Height) 696 if ((int)width < m_Width || (int)height < m_Height)
698 return; 697 return;
699 698
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 FX_BOOL CPDF_ImageLoader::Continue(CPDF_ImageLoaderHandle* LoadHandle, 1621 FX_BOOL CPDF_ImageLoader::Continue(CPDF_ImageLoaderHandle* LoadHandle,
1623 IFX_Pause* pPause) { 1622 IFX_Pause* pPause) {
1624 return LoadHandle->Continue(pPause); 1623 return LoadHandle->Continue(pPause);
1625 } 1624 }
1626 CPDF_ImageLoader::~CPDF_ImageLoader() { 1625 CPDF_ImageLoader::~CPDF_ImageLoader() {
1627 if (!m_bCached) { 1626 if (!m_bCached) {
1628 delete m_pBitmap; 1627 delete m_pBitmap;
1629 delete m_pMask; 1628 delete m_pMask;
1630 } 1629 }
1631 } 1630 }
OLDNEW
« no previous file with comments | « core/include/fxcodec/fx_codec.h ('k') | core/src/fxcodec/codec/codec_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698