summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/pageint.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-03-17 11:16:18 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-03-17 22:11:51 +0000
commitac6e2a059dbd74f6f9f1c216600496cfa5676387 (patch)
treee844921177b0f7ba09c2a3c34ead15b0c24b4000 /core/fpdfapi/page/pageint.h
parent7a1220dc1c0051f2a6bf50f3f38419ae51ecb9a1 (diff)
downloadpdfium-ac6e2a059dbd74f6f9f1c216600496cfa5676387.tar.xz
Bring CPDF_ICCBasedCS closer to PDF spec.
The spec says the N dictionary field is required and must be set to a valid value. Adjust the code based on this assertion. BUG=pdfium:675,chromium:691967,chromium:702238 Change-Id: Iaa76fa0e16ce4aaa9822ad471668cbf8af5fb7cb Reviewed-on: https://pdfium-review.googlesource.com/3112 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/pageint.h')
-rw-r--r--core/fpdfapi/page/pageint.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/fpdfapi/page/pageint.h b/core/fpdfapi/page/pageint.h
index 0737c2ed6e..9637155343 100644
--- a/core/fpdfapi/page/pageint.h
+++ b/core/fpdfapi/page/pageint.h
@@ -138,12 +138,17 @@ class CPDF_IccProfile {
public:
CPDF_IccProfile(const uint8_t* pData, uint32_t dwSize);
~CPDF_IccProfile();
+
+ bool IsValid() const { return IsSRGB() || IsSupported(); }
+ bool IsSRGB() const { return m_bsRGB; }
+ bool IsSupported() const { return !!m_pTransform; }
+ void* transform() { return m_pTransform; }
uint32_t GetComponents() const { return m_nSrcComponents; }
- bool m_bsRGB;
- void* m_pTransform;
private:
- uint32_t m_nSrcComponents;
+ const bool m_bsRGB;
+ void* m_pTransform = nullptr;
+ uint32_t m_nSrcComponents = 0;
};
class CPDF_DeviceCS : public CPDF_ColorSpace {