Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp

Issue 1419643005: Merge to XFA: Add type cast definitions for CPDF_Array. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 9a1d48a41610b9f04f3f8ff5f68102cbb4aea555..436cca6d99ce89aa7147f2c94ad20516e58be948 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -343,10 +343,8 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpace(CPDF_Object* pCSObj,
return pDefaultCS ? GetColorSpace(pDefaultCS, nullptr) : pCS;
}
- if (pCSObj->GetType() != PDFOBJ_ARRAY)
- return nullptr;
- CPDF_Array* pArray = (CPDF_Array*)pCSObj;
- if (pArray->GetCount() == 0)
+ CPDF_Array* pArray = pCSObj->AsArray();
+ if (!pArray || pArray->GetCount() == 0)
return nullptr;
if (pArray->GetCount() == 1)
return GetColorSpace(pArray->GetElementValue(0), pResources);

Powered by Google App Engine
This is Rietveld 408576698