summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_shadingpattern.h
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-12-19 19:49:53 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-19 19:49:53 +0000
commit30ef542b6f631f0ffbcd4110857e7c1a304a8a23 (patch)
treece65ed4325e46cbf1e3df2ed08e98c107259065b /core/fpdfapi/page/cpdf_shadingpattern.h
parent58c2c144c5ac6a7397573d2f25d1ba9c79bc4f15 (diff)
downloadpdfium-30ef542b6f631f0ffbcd4110857e7c1a304a8a23.tar.xz
Add parameter validation to CPDF_ShadingPattern.
Check if the ColorSpace and the Function params are valid for the shading type. Bug: chromium:794990 Change-Id: I022e976e5489a6b325d95ad16eab056235a8944d Reviewed-on: https://pdfium-review.googlesource.com/21450 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_shadingpattern.h')
-rw-r--r--core/fpdfapi/page/cpdf_shadingpattern.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_shadingpattern.h b/core/fpdfapi/page/cpdf_shadingpattern.h
index d0fafef0db..17b6e4bb8c 100644
--- a/core/fpdfapi/page/cpdf_shadingpattern.h
+++ b/core/fpdfapi/page/cpdf_shadingpattern.h
@@ -61,6 +61,12 @@ class CPDF_ShadingPattern : public CPDF_Pattern {
}
private:
+ // Constraints in PDF 1.7 spec, 4.6.3 Shading Patterns, pages 308-331.
+ bool Validate() const;
+ bool ValidateFunctions(uint32_t nExpectedNumFunctions,
+ uint32_t nExpectedNumInputs,
+ uint32_t nExpectedNumOutputs) const;
+
ShadingType m_ShadingType;
bool m_bShadingObj;
UnownedPtr<CPDF_Object> m_pShadingObj;