Initialize colour values 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>
diff --git a/core/fpdfapi/page/cpdf_meshstream.cpp b/core/fpdfapi/page/cpdf_meshstream.cpp index c173bc6..ac93513 100644 --- a/core/fpdfapi/page/cpdf_meshstream.cpp +++ b/core/fpdfapi/page/cpdf_meshstream.cpp
@@ -204,9 +204,9 @@ (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);