From 20e6688ab462d7ef749c1f97b83b5f325e88f698 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 2 Aug 2018 19:44:33 +0000 Subject: 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 Reviewed-by: Henrique Nakashima --- fpdfsdk/formfiller/cba_fontmap.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'fpdfsdk') 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 #include #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 pObject = + pFontDict->IsInline() ? pFontDict->Clone() + : pFontDict->MakeReference(m_pDocument.Get()); + pStreamResFontList->SetFor(sAlias, std::move(pObject)); } } -- cgit v1.2.3