diff options
author | weili <weili@chromium.org> | 2016-10-03 12:10:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-03 12:10:56 -0700 |
commit | d61f958385be285f3f3897ef3a3f010048608f1c (patch) | |
tree | 446db3b167ede38585cfea3ffe8a5cf414d74ad2 /core/fpdfapi/fpdf_font/cpdf_simplefont.cpp | |
parent | e5393582a7f5dbb655a97d64531638b302ee684e (diff) | |
download | pdfium-d61f958385be285f3f3897ef3a3f010048608f1c.tar.xz |
Detect resursive loading of type3 font char to avoid infinite loop
The original way of detecting loops was passing a level parameter
through various functions. This missed some cases which also lead
to load type3 font char, for example, FindFont() may call
CheckType3FontMetrics() which may eventually lead to LoadChar().
The new way is to store the char loading depth, and abort when the depth
exceeds the max.
BUG=chromium:651304
Review-Url: https://codereview.chromium.org/2384853002
Diffstat (limited to 'core/fpdfapi/fpdf_font/cpdf_simplefont.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_font/cpdf_simplefont.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp b/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp index dda642380f..3bb3730fb5 100644 --- a/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp @@ -78,7 +78,7 @@ void CPDF_SimpleFont::LoadCharMetrics(int charcode) { } } -int CPDF_SimpleFont::GetCharWidthF(uint32_t charcode, int level) { +int CPDF_SimpleFont::GetCharWidthF(uint32_t charcode) { if (charcode > 0xff) charcode = 0; @@ -91,7 +91,7 @@ int CPDF_SimpleFont::GetCharWidthF(uint32_t charcode, int level) { return m_CharWidth[charcode]; } -FX_RECT CPDF_SimpleFont::GetCharBBox(uint32_t charcode, int level) { +FX_RECT CPDF_SimpleFont::GetCharBBox(uint32_t charcode) { if (charcode > 0xff) charcode = 0; |