Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp |
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp |
index 2dff76618750a4bf009c8fdd5158145b932c9ed0..29c1a007cfa23b531e9c57ab7768733a9845e228 100644 |
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp |
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp |
@@ -143,18 +143,15 @@ CPDF_Dictionary* CPDF_Document::GetPage(int iPage) { |
return nullptr; |
if (m_bLinearized && (iPage == (int)m_dwFirstPageNo)) { |
- CPDF_Object* pObj = GetIndirectObject(m_dwFirstPageObjNum); |
- if (pObj && pObj->GetType() == PDFOBJ_DICTIONARY) { |
- return static_cast<CPDF_Dictionary*>(pObj); |
- } |
+ if (CPDF_Dictionary* pDict = |
+ ToDictionary(GetIndirectObject(m_dwFirstPageObjNum))) |
+ return pDict; |
} |
int objnum = m_PageList.GetAt(iPage); |
if (objnum) { |
- CPDF_Object* pObj = GetIndirectObject(objnum); |
- if (pObj && pObj->GetType() == PDFOBJ_DICTIONARY) { |
- return static_cast<CPDF_Dictionary*>(pObj); |
- } |
+ if (CPDF_Dictionary* pDict = ToDictionary(GetIndirectObject(objnum))) |
+ return pDict; |
} |
CPDF_Dictionary* pRoot = GetRoot(); |