Index: core/src/fpdfapi/fpdf_font/fpdf_font.cpp |
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp |
index c52b4fe2786907e85bb0255b11e4636cb1524499..77f7f118fccd7be7365ae4220d5a7c0d96c1e35f 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; |