diff options
author | Lei Zhang <thestig@chromium.org> | 2017-12-22 00:30:04 -0800 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-22 19:44:07 +0000 |
commit | 05dcbc931eacb72f1a11835ae282fc8434b7a434 (patch) | |
tree | d05902195813a9760e6d90f5189c2dd421676975 /core/fpdfapi/page/cpdf_devicecs.cpp | |
parent | 891aaf63b3490989a189bcc51b18647073f988d4 (diff) | |
download | pdfium-chromium/3307.tar.xz |
Only set CPDF_ColorSpace component count on successful load.chromium/3310chromium/3309chromium/3308chromium/3307chromium/3306chromium/3305chromium/3304chromium/3303chromium/3302
Make sure all CPDF_ColorSpace instances consistently call v_Load().
Change-Id: I15c1608c36781a03131884abceff1ecc4a9a1eb1
Reviewed-on: https://pdfium-review.googlesource.com/21911
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_devicecs.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_devicecs.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/core/fpdfapi/page/cpdf_devicecs.cpp b/core/fpdfapi/page/cpdf_devicecs.cpp index efd0ae4f46..9eb4123b25 100644 --- a/core/fpdfapi/page/cpdf_devicecs.cpp +++ b/core/fpdfapi/page/cpdf_devicecs.cpp @@ -54,14 +54,23 @@ void ReverseRGB(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels) { } } -CPDF_DeviceCS::CPDF_DeviceCS(int family) - : CPDF_ColorSpace(nullptr, family, ComponentsForFamily(family)) { +CPDF_DeviceCS::CPDF_DeviceCS(int family) : CPDF_ColorSpace(nullptr, family) { ASSERT(family == PDFCS_DEVICEGRAY || family == PDFCS_DEVICERGB || family == PDFCS_DEVICECMYK); + SetComponentsForStockCS(ComponentsForFamily(GetFamily())); } CPDF_DeviceCS::~CPDF_DeviceCS() {} +uint32_t CPDF_DeviceCS::v_Load(CPDF_Document* pDoc, + CPDF_Array* pArray, + std::set<CPDF_Object*>* pVisited) { + // Unlike other classes that inherit from CPDF_ColorSpace, CPDF_DeviceCS is + // never loaded by CPDF_ColorSpace. + NOTREACHED(); + return 0; +} + bool CPDF_DeviceCS::GetRGB(float* pBuf, float* R, float* G, float* B) const { switch (m_Family) { case PDFCS_DEVICEGRAY: |