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

Unified Diff: core/fpdfapi/fpdf_font/cpdf_type3font.h

Issue 2384853002: Detect resursive loading of type3 font char to avoid infinite loop (Closed)
Patch Set: address comments Created 4 years, 2 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 | « core/fpdfapi/fpdf_font/cpdf_simplefont.cpp ('k') | core/fpdfapi/fpdf_font/cpdf_type3font.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/cpdf_type3font.h
diff --git a/core/fpdfapi/fpdf_font/cpdf_type3font.h b/core/fpdfapi/fpdf_font/cpdf_type3font.h
index 2b840f22670995ce374404338eac4edb2fe67e19..03078298f179c1fe2a011c56524fff7e8464551c 100644
--- a/core/fpdfapi/fpdf_font/cpdf_type3font.h
+++ b/core/fpdfapi/fpdf_font/cpdf_type3font.h
@@ -26,13 +26,13 @@ class CPDF_Type3Font : public CPDF_SimpleFont {
bool IsType3Font() const override;
const CPDF_Type3Font* AsType3Font() const override;
CPDF_Type3Font* AsType3Font() override;
- int GetCharWidthF(uint32_t charcode, int level = 0) override;
- FX_RECT GetCharBBox(uint32_t charcode, int level = 0) override;
+ int GetCharWidthF(uint32_t charcode) override;
+ FX_RECT GetCharBBox(uint32_t charcode) override;
void SetPageResources(CPDF_Dictionary* pResources) {
m_pPageResources = pResources;
}
- CPDF_Type3Char* LoadChar(uint32_t charcode, int level = 0);
+ CPDF_Type3Char* LoadChar(uint32_t charcode);
void CheckType3FontMetrics();
CFX_Matrix& GetFontMatrix() { return m_FontMatrix; }
@@ -52,6 +52,8 @@ class CPDF_Type3Font : public CPDF_SimpleFont {
CPDF_Dictionary* m_pPageResources;
CPDF_Dictionary* m_pFontResources;
std::map<uint32_t, std::unique_ptr<CPDF_Type3Char>> m_CacheMap;
+ // The depth char loading is in, to avoid recurive calling LoadChar().
+ int m_CharLoadingDepth;
};
#endif // CORE_FPDFAPI_FPDF_FONT_CPDF_TYPE3FONT_H_
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_simplefont.cpp ('k') | core/fpdfapi/fpdf_font/cpdf_type3font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698