diff options
author | Lei Zhang <thestig@chromium.org> | 2018-04-12 20:58:56 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-12 20:58:56 +0000 |
commit | 2772a2d944c8573aa187339b0b5ea059d1293c36 (patch) | |
tree | 6093cb350e78c64ce32fe2c7a433258f70c1ad58 /core/fpdfapi/page/cpdf_colorstate.cpp | |
parent | 9e625db795ca7e112d692bda7200b69a873d75f7 (diff) | |
download | pdfium-2772a2d944c8573aa187339b0b5ea059d1293c36.tar.xz |
More CPDF_Color improvements.
Make Copy() take a const-ref parameter. As is, the parameter is a
pointer and it is dereferenced without any checks, and there are no
crash reports as a result of that.
Also mention GetPattern() should only be called when IsPattern() returns
true.
Change-Id: Ice3b7c941532d5a312fdd8f0c032e08d1ee1c6b5
Reviewed-on: https://pdfium-review.googlesource.com/30430
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_colorstate.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_colorstate.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfapi/page/cpdf_colorstate.cpp b/core/fpdfapi/page/cpdf_colorstate.cpp index 227fd62045..b1f14c88b1 100644 --- a/core/fpdfapi/page/cpdf_colorstate.cpp +++ b/core/fpdfapi/page/cpdf_colorstate.cpp @@ -147,8 +147,8 @@ CPDF_ColorState::ColorData::ColorData() CPDF_ColorState::ColorData::ColorData(const ColorData& src) : m_FillColorRef(src.m_FillColorRef), m_StrokeColorRef(src.m_StrokeColorRef) { - m_FillColor.Copy(&src.m_FillColor); - m_StrokeColor.Copy(&src.m_StrokeColor); + m_FillColor.Copy(src.m_FillColor); + m_StrokeColor.Copy(src.m_StrokeColor); } CPDF_ColorState::ColorData::~ColorData() {} |