summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2018-06-20 20:56:14 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-20 20:56:14 +0000
commitcc4802edc4faee4bafae5219e94a5a22bfbb684b (patch)
tree68ac60938d559e95cc72d4b1af7f77757fbd6d90 /fpdfsdk
parentc62e8489042c5efaa3b666846b38a52da3b91481 (diff)
downloadpdfium-cc4802edc4faee4bafae5219e94a5a22bfbb684b.tar.xz
Fix a couple of CPDF_DefaultAppearance::GetFont usageschromium/3467
Bug: 853238 Change-Id: I133be340fd877e9acd2733845d454924dc86d295 Reviewed-on: https://pdfium-review.googlesource.com/35711 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/formfiller/cba_fontmap.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp
index d8d7dffd69..08a3021a73 100644
--- a/fpdfsdk/formfiller/cba_fontmap.cpp
+++ b/fpdfsdk/formfiller/cba_fontmap.cpp
@@ -218,12 +218,7 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(ByteString* sAlias) {
CPDF_DefaultAppearance appearance(sDA);
float font_size;
Optional<ByteString> font = appearance.GetFont(&font_size);
- if (font) {
- ByteString sDecodedFontName = PDF_NameDecode(font->AsStringView());
- *sAlias = sDecodedFontName.Right(sDecodedFontName.GetLength() - 1);
- } else {
- *sAlias = ByteString();
- }
+ *sAlias = font.value_or(ByteString());
CPDF_Dictionary* pFontDict = nullptr;
if (CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDictFor("AP")) {