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

Unified Diff: core/fpdfapi/fpdf_page/cpdf_textobject.cpp

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_page/cpdf_textobject.h ('k') | core/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_page/cpdf_textobject.cpp
diff --git a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
index 4b9f335ea3c695c268e6b322af1ede13e810e749..1119d2965f32d09019256b98d578e2662dbe130c 100644
--- a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
@@ -217,7 +217,7 @@ FX_FLOAT CPDF_TextObject::GetCharWidth(uint32_t charcode) const {
bVertWriting = pCIDFont->IsVertWriting();
}
if (!bVertWriting)
- return pFont->GetCharWidthF(charcode, 0) * fontsize;
+ return pFont->GetCharWidthF(charcode) * fontsize;
uint16_t CID = pCIDFont->CIDFromCharCode(charcode);
return pCIDFont->GetVertWidth(CID) * fontsize;
@@ -241,8 +241,7 @@ FX_FLOAT CPDF_TextObject::GetFontSize() const {
void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
FX_FLOAT* pTextAdvanceY,
- FX_FLOAT horz_scale,
- int level) {
+ FX_FLOAT horz_scale) {
FX_FLOAT curpos = 0;
FX_FLOAT min_x = 10000 * 1.0f;
FX_FLOAT max_x = -10000 * 1.0f;
@@ -265,7 +264,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
}
m_pCharPos[i - 1] = curpos;
}
- FX_RECT char_rect = pFont->GetCharBBox(charcode, level);
+ FX_RECT char_rect = pFont->GetCharBBox(charcode);
FX_FLOAT charwidth;
if (!bVertWriting) {
if (min_y > char_rect.top) {
@@ -294,7 +293,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
if (max_x < char_right) {
max_x = char_right;
}
- charwidth = pFont->GetCharWidthF(charcode, level) * fontsize / 1000;
+ charwidth = pFont->GetCharWidthF(charcode) * fontsize / 1000;
} else {
uint16_t CID = pCIDFont->CIDFromCharCode(charcode);
short vx;
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_textobject.h ('k') | core/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698