Fix heap use after free in Document::DoFieldDelay and Document::delay
[pdfium.git] / fpdfsdk / src / fpdfeditimg.cpp
index c29d2b7..f06564e 100644 (file)
@@ -4,16 +4,16 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_edit.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdfedit.h"
 
 
 DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document)
 {
        if (!document)
                return NULL;
-       CPDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject;
-       CPDF_Image* pImg = FX_NEW CPDF_Image((CPDF_Document *)document);
+       CPDF_ImageObject* pImageObj = new CPDF_ImageObject;
+       CPDF_Image* pImg = new CPDF_Image((CPDF_Document *)document);
        pImageObj->m_pImage = pImg;
        return pImageObj;
 }
@@ -23,8 +23,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCou
        if (!image_object || !fileAccess)
                return FALSE;
 
-       IFX_FileRead* pFile = FX_NEW CPDF_CustomAccess(fileAccess);
-
+       IFX_FileRead* pFile = new CPDF_CustomAccess(fileAccess);
        CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
        pImgObj->m_GeneralState.GetModify();
        for (int index=0;index<nCount;index++)