diff options
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdfeditimg.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp index 1207ecf06d..6a300c9e62 100644 --- a/fpdfsdk/fpdfeditimg.cpp +++ b/fpdfsdk/fpdfeditimg.cpp @@ -20,16 +20,19 @@ bool LoadJpegHelper(FPDF_PAGE* pages, FPDF_PAGEOBJECT image_object, FPDF_FILEACCESS* fileAccess, bool inlineJpeg) { - if (!image_object || !fileAccess || !pages) + if (!image_object || !fileAccess) return false; CFX_RetainPtr<IFX_SeekableReadStream> pFile = MakeSeekableReadStream(fileAccess); CPDF_ImageObject* pImgObj = reinterpret_cast<CPDF_ImageObject*>(image_object); - for (int index = 0; index < nCount; index++) { - CPDF_Page* pPage = CPDFPageFromFPDFPage(pages[index]); - if (pPage) - pImgObj->GetImage()->ResetCache(pPage, nullptr); + + if (pages) { + for (int index = 0; index < nCount; index++) { + CPDF_Page* pPage = CPDFPageFromFPDFPage(pages[index]); + if (pPage) + pImgObj->GetImage()->ResetCache(pPage, nullptr); + } } if (inlineJpeg) |