From 232b918d1f0faec230652f4097b834257a7dbb27 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 3 Apr 2018 16:32:19 +0000 Subject: Re-arrange so inline vectors come last in structs. This might make the memory tools more effective in finding OOBs. Change-Id: Id093bb0a88c37954c80d612ac00b5a168e75bdbf Reviewed-on: https://pdfium-review.googlesource.com/29550 Reviewed-by: dsinclair Commit-Queue: Tom Sepez --- core/fpdfapi/render/cpdf_renderstatus.cpp | 16 +++++++++------- core/fpdfapi/render/cpdf_type3cache.cpp | 3 ++- core/fpdfapi/render/cpdf_type3glyphs.h | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) (limited to 'core/fpdfapi/render') diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index d5204fe500..367519ac83 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -696,7 +696,6 @@ int BiInterpolImpl(int c0, struct Coon_Color { Coon_Color() { memset(comp, 0, sizeof(int) * 3); } - int comp[3]; // Returns true if successful, false if overflow detected. bool BiInterpol(Coon_Color colors[4], @@ -717,16 +716,12 @@ struct Coon_Color { return std::max({abs(comp[0] - o.comp[0]), abs(comp[1] - o.comp[1]), abs(comp[2] - o.comp[2])}); } + + int comp[3]; }; #define COONCOLOR_THRESHOLD 4 struct CPDF_PatchDrawer { - Coon_Color patch_colors[4]; - int max_delta; - CFX_PathData path; - CFX_RenderDevice* pDevice; - int fill_mode; - int alpha; void Draw(int x_scale, int y_scale, int left, @@ -825,6 +820,13 @@ struct CPDF_PatchDrawer { } } } + + int max_delta; + CFX_PathData path; + CFX_RenderDevice* pDevice; + int fill_mode; + int alpha; + Coon_Color patch_colors[4]; }; void DrawCoonPatchMeshes( diff --git a/core/fpdfapi/render/cpdf_type3cache.cpp b/core/fpdfapi/render/cpdf_type3cache.cpp index fe9dfbf9e0..33a440f1ca 100644 --- a/core/fpdfapi/render/cpdf_type3cache.cpp +++ b/core/fpdfapi/render/cpdf_type3cache.cpp @@ -21,8 +21,9 @@ namespace { struct CPDF_UniqueKeyGen { void Generate(int count, ...); - char m_Key[128]; + int m_KeyLen; + char m_Key[128]; }; void CPDF_UniqueKeyGen::Generate(int count, ...) { diff --git a/core/fpdfapi/render/cpdf_type3glyphs.h b/core/fpdfapi/render/cpdf_type3glyphs.h index 778b639642..7756be309f 100644 --- a/core/fpdfapi/render/cpdf_type3glyphs.h +++ b/core/fpdfapi/render/cpdf_type3glyphs.h @@ -24,10 +24,10 @@ class CPDF_Type3Glyphs { void AdjustBlue(float top, float bottom, int& top_line, int& bottom_line); std::map> m_GlyphMap; - int m_TopBlue[TYPE3_MAX_BLUES]; - int m_BottomBlue[TYPE3_MAX_BLUES]; int m_TopBlueCount; int m_BottomBlueCount; + int m_TopBlue[TYPE3_MAX_BLUES]; + int m_BottomBlue[TYPE3_MAX_BLUES]; }; #endif // CORE_FPDFAPI_RENDER_CPDF_TYPE3GLYPHS_H_ -- cgit v1.2.3