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

Unified Diff: fpdfsdk/src/fpdfeditimg.cpp

Issue 1406543004: Introduce CPDFPageFromFPDFPage() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase. 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
« no previous file with comments | « fpdfsdk/src/fpdfdoc.cpp ('k') | fpdfsdk/src/fpdfeditpage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfeditimg.cpp
diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp
index 0c8ea1627a99ed04599f19c51ae17d17a12f9d07..73fc2511957666e42453747554a758c48bd1d394 100644
--- a/fpdfsdk/src/fpdfeditimg.cpp
+++ b/fpdfsdk/src/fpdfeditimg.cpp
@@ -30,7 +30,9 @@ FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages,
CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
pImgObj->m_GeneralState.GetModify();
for (int index = 0; index < nCount; index++) {
- CPDF_Page* pPage = (CPDF_Page*)pages[index];
+ CPDF_Page* pPage = CPDFPageFromFPDFPage(pages[index]);
+ if (!pPage)
+ continue;
pImgObj->m_pImage->ResetCache(pPage, NULL);
}
pImgObj->m_pImage->SetJpegImage(pFile);
@@ -69,7 +71,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,
CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
pImgObj->m_GeneralState.GetModify();
for (int index = 0; index < nCount; index++) {
- CPDF_Page* pPage = (CPDF_Page*)pages[index];
+ CPDF_Page* pPage = CPDFPageFromFPDFPage(pages[index]);
+ if (!pPage)
+ continue;
pImgObj->m_pImage->ResetCache(pPage, NULL);
}
pImgObj->m_pImage->SetImage(pBmp, FALSE);
« no previous file with comments | « fpdfsdk/src/fpdfdoc.cpp ('k') | fpdfsdk/src/fpdfeditpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698