diff options
author | Lei Zhang <thestig@chromium.org> | 2018-04-12 17:56:35 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-12 17:56:35 +0000 |
commit | 6998bc502dd2798115024c48b95e6e9180b2b3ee (patch) | |
tree | 5a666d322c0ce76738bf905d06da7235e1edec83 /core/fpdfapi/page/cpdf_patterncs.cpp | |
parent | a8db06a715cd0090a8c838a7b2861ca3c657f6a2 (diff) | |
download | pdfium-6998bc502dd2798115024c48b95e6e9180b2b3ee.tar.xz |
Make the input data to CPDF_ColorSpace::GetRGB() const.
Make a copy of the input data when clamping it in CPDF_Function::Call().
Change-Id: I1d2b3d080977f0f9a4c3ccaf111780867668991a
Reviewed-on: https://pdfium-review.googlesource.com/30350
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_patterncs.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_patterncs.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/fpdfapi/page/cpdf_patterncs.cpp b/core/fpdfapi/page/cpdf_patterncs.cpp index b4b680f026..5da176984b 100644 --- a/core/fpdfapi/page/cpdf_patterncs.cpp +++ b/core/fpdfapi/page/cpdf_patterncs.cpp @@ -50,10 +50,13 @@ uint32_t CPDF_PatternCS::v_Load(CPDF_Document* pDoc, return m_pBaseCS->CountComponents() + 1; } -bool CPDF_PatternCS::GetRGB(float* pBuf, float* R, float* G, float* B) const { +bool CPDF_PatternCS::GetRGB(const float* pBuf, + float* R, + float* G, + float* B) const { if (m_pBaseCS) { ASSERT(m_pBaseCS->GetFamily() != PDFCS_PATTERN); - PatternValue* pvalue = reinterpret_cast<PatternValue*>(pBuf); + const auto* pvalue = reinterpret_cast<const PatternValue*>(pBuf); if (m_pBaseCS->GetRGB(pvalue->m_Comps, R, G, B)) return true; } |