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

Unified Diff: fpdfsdk/src/fpdfppo.cpp

Issue 553613003: Check the validity of pointers before they are utilized (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfppo.cpp
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index b8d2125b7dab667e0e0d9d50aa708474309757b6..199c218430fb8e4fe497d7aec252cba25da0cda7 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -313,7 +313,13 @@ int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPt
}
else
{
- CPDF_Object* pClone = pRef->GetDirect()->Clone();
+ CPDF_Object* pClone = NULL;
+ if (pRef) {
Bo Xu 2014/09/08 00:54:24 No need to check pRef since line 303 already check
+ CPDF_Object* pDirect = pRef->GetDirect();
+ if (pDirect) {
+ pClone = pDirect->Clone();
+ }
+ }
if(!pClone)
return 0;
« 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