Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp

Issue 379923012: Fix uninitialized RGB in DrawShading (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 926ce8883b7aed83ba21caf3dbcd3639c50739d7..edc677736b08257133ce602311a64353df702f0f 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -66,7 +66,7 @@ static void _DrawAxialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2B
}
}
}
- FX_FLOAT R, G, B;
+ FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f;
pCS->GetRGB(pResults, R, G, B);
rgb_array[i] = FXARGB_TODIB(FXARGB_MAKE(alpha, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255)));
}
@@ -755,7 +755,7 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMat
for (int i = 0; i < pColorSpace->CountComponents(); i ++) {
comps[i] = pBackColor->GetNumber(i);
}
- FX_FLOAT R, G, B;
+ FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f;
pColorSpace->GetRGB(comps, R, G, B);
background = ArgbEncode(255, (FX_INT32)(R * 255), (FX_INT32)(G * 255), (FX_INT32)(B * 255));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698