summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cba_fontmap.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-02 19:44:33 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-02 19:44:33 +0000
commit20e6688ab462d7ef749c1f97b83b5f325e88f698 (patch)
tree78e5540965f8a71e359c23a6b61f2acb00d1a2e8 /fpdfsdk/formfiller/cba_fontmap.cpp
parent2d2b9934996277801a63bb0670899030dcdbcd35 (diff)
downloadpdfium-20e6688ab462d7ef749c1f97b83b5f325e88f698.tar.xz
Handle inline font dicts in CBA_FontMap::AddFontToAnnotDict().
BUG=chromium:869171 Change-Id: I0176bcafa8a63396d916916b5e10b96573085d04 Reviewed-on: https://pdfium-review.googlesource.com/39414 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/formfiller/cba_fontmap.cpp')
-rw-r--r--fpdfsdk/formfiller/cba_fontmap.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp
index 08a3021a73..ae0cc80bf2 100644
--- a/fpdfsdk/formfiller/cba_fontmap.cpp
+++ b/fpdfsdk/formfiller/cba_fontmap.cpp
@@ -6,6 +6,7 @@
#include "fpdfsdk/formfiller/cba_fontmap.h"
+#include <memory>
#include <utility>
#include "core/fpdfapi/font/cpdf_font.h"
@@ -187,8 +188,11 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
"Font", pStreamResFontList->MakeReference(m_pDocument.Get()));
}
if (!pStreamResFontList->KeyExist(sAlias)) {
- pStreamResFontList->SetFor(
- sAlias, pFont->GetFontDict()->MakeReference(m_pDocument.Get()));
+ CPDF_Dictionary* pFontDict = pFont->GetFontDict();
+ std::unique_ptr<CPDF_Object> pObject =
+ pFontDict->IsInline() ? pFontDict->Clone()
+ : pFontDict->MakeReference(m_pDocument.Get());
+ pStreamResFontList->SetFor(sAlias, std::move(pObject));
}
}