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

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

Issue 384593002: Fix uninitialized coords in _DrawCoonPatchMeshes (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 0bf6311b1906d18da099b61c645658af5fc9dab9..ec18d3fd311b54af6866dc4958075e12963404d9 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -688,6 +688,11 @@ static void _DrawCoonPatchMeshes(FX_BOOL bTensor, CFX_DIBitmap* pBitmap, CFX_Aff
pPoints[i].m_Flag = FXPT_BEZIERTO;
}
CFX_FloatPoint coords[16];
+ for (int i = 0; i < 16; i ++)
palmer 2014/07/10 23:11:01 This is fine. But a more elegant solution is to d
jun_fang 2014/07/15 01:13:41 CFX_FloatPoint is created by CFX_PSVTTemplate<FX_F
palmer 2014/07/15 01:49:17 Yes. I am saying, you could give that template a d
jun_fang 2014/07/15 03:56:17 :-). I know. I tried to add a default constructor.
Ryan Sleevi 2014/07/15 23:59:00 Just happened to see this CL go by. The nice thing
+ {
+ coords[i].Set(0.0f, 0.0f);
+ }
+
int point_count = bTensor ? 16 : 12;
while (!stream.m_BitStream.IsEOF()) {
FX_DWORD flag = stream.GetFlag();
palmer 2014/07/10 23:11:01 Because this value is untrustworthy (comes from th
jun_fang 2014/07/15 01:13:41 The value from GetFlag() is limited to 0 to 3. The
palmer 2014/07/15 01:49:17 Acknowledged.
« 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