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

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

Issue 792113003: m_pColorSpace can not be NULL for image object with DCTDecode filter (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years 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 | no next file » | 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 "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #include "../../../include/fxcodec/fx_codec.h" 8 #include "../../../include/fxcodec/fx_codec.h"
9 #include "../../../include/fpdfapi/fpdf_module.h" 9 #include "../../../include/fpdfapi/fpdf_module.h"
10 #include "../../../include/fpdfapi/fpdf_render.h" 10 #include "../../../include/fpdfapi/fpdf_render.h"
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 497 }
498 ValidateDictParam(); 498 ValidateDictParam();
499 m_pCompData = GetDecodeAndMaskArray(m_bDefaultDecode, m_bColorKey); 499 m_pCompData = GetDecodeAndMaskArray(m_bDefaultDecode, m_bColorKey);
500 if (m_pCompData == NULL) { 500 if (m_pCompData == NULL) {
501 return FALSE; 501 return FALSE;
502 } 502 }
503 return TRUE; 503 return TRUE;
504 } 504 }
505 DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX _BOOL& bColorKey) 505 DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX _BOOL& bColorKey)
506 { 506 {
507 if (m_pColorSpace == NULL) {
508 return NULL;
509 }
507 DIB_COMP_DATA* pCompData = FX_Alloc(DIB_COMP_DATA, m_nComponents); 510 DIB_COMP_DATA* pCompData = FX_Alloc(DIB_COMP_DATA, m_nComponents);
508 if (pCompData == NULL) { 511 if (pCompData == NULL) {
509 return NULL; 512 return NULL;
510 } 513 }
511 int max_data = (1 << m_bpc) - 1; 514 int max_data = (1 << m_bpc) - 1;
512 CPDF_Array* pDecode = m_pDict->GetArray(FX_BSTRC("Decode")); 515 CPDF_Array* pDecode = m_pDict->GetArray(FX_BSTRC("Decode"));
513 if (pDecode) { 516 if (pDecode) {
514 for (FX_DWORD i = 0; i < m_nComponents; i ++) { 517 for (FX_DWORD i = 0; i < m_nComponents; i ++) {
515 pCompData[i].m_DecodeMin = pDecode->GetNumber(i * 2); 518 pCompData[i].m_DecodeMin = pDecode->GetNumber(i * 2);
516 FX_FLOAT max = pDecode->GetNumber(i * 2 + 1); 519 FX_FLOAT max = pDecode->GetNumber(i * 2 + 1);
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 if (!m_bCached) { 1567 if (!m_bCached) {
1565 if (m_pBitmap) { 1568 if (m_pBitmap) {
1566 delete m_pBitmap; 1569 delete m_pBitmap;
1567 m_pBitmap = NULL; 1570 m_pBitmap = NULL;
1568 } 1571 }
1569 if (m_pMask) { 1572 if (m_pMask) {
1570 delete m_pMask; 1573 delete m_pMask;
1571 } 1574 }
1572 } 1575 }
1573 } 1576 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698