OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |