Index: core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp |
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp |
index 8972201b660df94b5f605b5b4d7e651c9f3639b5..02f0933f360089f2677ae74ed1e2664466a0b51a 100644 |
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp |
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp |
@@ -1215,9 +1215,8 @@ FX_BOOL CPDF_CIDFont::_Load() { |
->GetPageModule() |
->GetFontGlobals() |
->m_CMapManager.GetPredefinedCMap(cmap, m_pFontFile && m_bType1); |
- } else if (pEncoding->GetType() == PDFOBJ_STREAM) { |
+ } else if (CPDF_Stream* pStream = pEncoding->AsStream()) { |
m_pAllocatedCMap = m_pCMap = new CPDF_CMap; |
- CPDF_Stream* pStream = (CPDF_Stream*)pEncoding; |
CPDF_StreamAcc acc; |
acc.LoadAllData(pStream, FALSE); |
m_pCMap->LoadEmbedded(acc.GetData(), acc.GetSize()); |
@@ -1265,9 +1264,9 @@ FX_BOOL CPDF_CIDFont::_Load() { |
CPDF_Object* pmap = |
pCIDFontDict->GetElementValue(FX_BSTRC("CIDToGIDMap")); |
if (pmap) { |
- if (pmap->GetType() == PDFOBJ_STREAM) { |
+ if (CPDF_Stream* pStream = pmap->AsStream()) { |
m_pCIDToGIDMap = new CPDF_StreamAcc; |
- m_pCIDToGIDMap->LoadAllData((CPDF_Stream*)pmap, FALSE); |
+ m_pCIDToGIDMap->LoadAllData(pStream, FALSE); |
} else if (pmap->GetString() == FX_BSTRC("Identity")) { |
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
if (m_pFontFile) { |