diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-04-24 11:30:17 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-24 18:22:24 +0000 |
commit | 302cd78d00c280cb212a5934a7a8293851e9650c (patch) | |
tree | 56254eb280f547d15196d0d76d03842649b0a462 /core/fpdfapi/page/cpdf_meshstream.cpp | |
parent | 67b2a358814beb7135552219cceca8c9b3f137a1 (diff) | |
download | pdfium-302cd78d00c280cb212a5934a7a8293851e9650c.tar.xz |
Initialize colour valueschromium/3080
The colour values returned from the ColorSpace GetRBG methods may not
have set a value. This CL updates the CPDF_MeshStream to always
initialize the values to 0 so they can't be used uninitialized.
Bug: chromium:714074
Change-Id: Id2db5eabe31d2ff19f9330b2bc5c681680cf461d
Reviewed-on: https://pdfium-review.googlesource.com/4450
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_meshstream.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_meshstream.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fpdfapi/page/cpdf_meshstream.cpp b/core/fpdfapi/page/cpdf_meshstream.cpp index c173bc633a..ac93513163 100644 --- a/core/fpdfapi/page/cpdf_meshstream.cpp +++ b/core/fpdfapi/page/cpdf_meshstream.cpp @@ -204,9 +204,9 @@ std::tuple<float, float, float> CPDF_MeshStream::ReadColor() { (m_ColorMax[i] - m_ColorMin[i]) / m_ComponentMax; } - float r; - float g; - float b; + float r = 0.0; + float g = 0.0; + float b = 0.0; if (m_funcs.empty()) { m_pCS->GetRGB(color_value, &r, &g, &b); return std::tuple<float, float, float>(r, g, b); |