From: Tom Sepez Date: Thu, 6 Nov 2014 23:00:36 +0000 (-0800) Subject: Fix bug with reading from uninitialized variable found by VC++'s /analyze. X-Git-Url: http://downloads.foxitsoftware.com/web/?p=pdfium.git;a=commitdiff_plain;h=09a22a6cd9758e630202d1730aaa8fd7898c91cb;hp=d9ecee1065cf391979dee0051b53fb5ff729ca2e Fix bug with reading from uninitialized variable found by VC++'s /analyze. The flag variable is conditionally initialized but unconditionally read. Warning was: src\fpdfapi\fpdf_page\fpdf_page_pattern.cpp(274) : warning C6001: Using uninitialized memory 'flag'. BUG=427616 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/703213004 --- diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp index 467ef9b..4644302 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp @@ -266,7 +266,7 @@ CFX_FloatRect _GetShadingBBox(CPDF_Stream* pStream, int type, const CFX_AffineMa int full_point_count = type == 7 ? 16 : (type == 6 ? 12 : 1); int full_color_count = (type == 6 || type == 7) ? 4 : 1; while (!stream.m_BitStream.IsEOF()) { - FX_DWORD flag; + FX_DWORD flag = 0; if (type != 5) { flag = stream.GetFlag(); }