Index: fpdfsdk/src/fpdfeditimg.cpp |
diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp |
index bb710789ccdc5c1c8fa391def31581365f93ad77..ef0576b6027cbc657ff92b5c6acf6f77c46850ca 100644 |
--- a/fpdfsdk/src/fpdfeditimg.cpp |
+++ b/fpdfsdk/src/fpdfeditimg.cpp |
@@ -9,10 +9,11 @@ |
DLLEXPORT FPDF_PAGEOBJECT STDCALL |
FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document) { |
- if (!document) |
- return NULL; |
+ CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); |
+ if (!pDoc) |
+ return nullptr; |
CPDF_ImageObject* pImageObj = new CPDF_ImageObject; |
- CPDF_Image* pImg = new CPDF_Image((CPDF_Document*)document); |
+ CPDF_Image* pImg = new CPDF_Image(pDoc); |
pImageObj->m_pImage = pImg; |
return pImageObj; |
} |