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

Unified Diff: core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp

Issue 1549073002: Fix crash from commit f6dafc9. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 49ec0bae9202b0275c53be1bdbb3ec43ab0600cb..95415b18d1e6b81e1871467245d937b1997f8bd3 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -1405,7 +1405,7 @@ void CPDF_Creator::InitNewObjNumOffsets() {
if (!pObj->IsModified()) {
continue;
}
- } else if (m_pParser->IsValidObjectNumber(objnum) &&
+ } else if (m_pParser && m_pParser->IsValidObjectNumber(objnum) &&
m_pParser->m_V5Type[objnum]) {
continue;
}
@@ -1434,7 +1434,7 @@ void CPDF_Creator::InitNewObjNumOffsets() {
FX_BOOL bNewStart = FALSE;
for (; i < iCount; i++) {
FX_DWORD dwCurObjNum = m_NewObjNumArray.ElementAt(i);
- bool bExist = m_pParser->IsValidObjectNumber(dwCurObjNum) &&
+ bool bExist = m_pParser && m_pParser->IsValidObjectNumber(dwCurObjNum) &&
m_ObjectOffset.GetPtrAt(dwCurObjNum);
if (bExist || dwCurObjNum - dwLastObjNum > 1) {
if (!bNewStart) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698