summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfapi/fpdf_font')
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index c52b4fe278..77f7f118fc 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -745,10 +745,11 @@ void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding,
GetPredefinedEncoding(iBaseEncoding, bsEncoding);
return;
}
- if (pEncoding->GetType() != PDFOBJ_DICTIONARY) {
+
+ CPDF_Dictionary* pDict = pEncoding->AsDictionary();
+ if (!pDict)
return;
- }
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pEncoding;
+
if (iBaseEncoding != PDFFONT_ENCODING_ADOBE_SYMBOL &&
iBaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS) {
CFX_ByteString bsEncoding = pDict->GetString(FX_BSTRC("BaseEncoding"));
@@ -781,6 +782,7 @@ void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding,
}
}
}
+
FX_BOOL CPDF_Font::IsStandardFont() const {
if (m_FontType != PDFFONT_TYPE1) {
return FALSE;