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 687e8e1d923b65c3865a384249a0c021c689e6e0..1b1ba8b0a44e32415f2bbaeda5c7a00aea5621d3 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) { |