summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/formfiller')
-rw-r--r--fpdfsdk/formfiller/cba_fontmap.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp
index 8bef264085..b195303800 100644
--- a/fpdfsdk/formfiller/cba_fontmap.cpp
+++ b/fpdfsdk/formfiller/cba_fontmap.cpp
@@ -220,7 +220,8 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString* sAlias) {
syntax.FindTagParamFromStart("Tf", 2);
CFX_ByteString sFontName(syntax.GetWord());
- *sAlias = PDF_NameDecode(sFontName).Mid(1);
+ CFX_ByteString sDecodedFontName = PDF_NameDecode(sFontName);
+ *sAlias = sDecodedFontName.Mid(1, sDecodedFontName.GetLength() - 1);
CPDF_Dictionary* pFontDict = nullptr;
if (CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDictFor("AP")) {