Index: core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp |
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp |
index b097389160efbbd5fa9bb0bf10f96ae90d7ba626..d6522158f1d5c6dbef7524fe50bf1759f16e8c09 100644 |
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp |
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp |
@@ -79,7 +79,7 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, |
return -1; |
} |
offset += 1; |
- CPDF_Array* p = (CPDF_Array*)pObj; |
+ const CPDF_Array* p = pObj->AsArray(); |
for (FX_DWORD i = 0; i < p->GetCount(); i++) { |
CPDF_Object* pElement = p->GetElement(i); |
if (pElement->GetObjNum()) { |
@@ -1195,7 +1195,7 @@ int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, |
return -1; |
} |
m_Offset += 1; |
- CPDF_Array* p = (CPDF_Array*)pObj; |
+ const CPDF_Array* p = pObj->AsArray(); |
for (FX_DWORD i = 0; i < p->GetCount(); i++) { |
CPDF_Object* pElement = p->GetElement(i); |
if (pElement->GetObjNum()) { |