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

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..a98640758150b4cb1590bfc8caac3d4562b4d036 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -313,9 +313,14 @@ int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPt
}
else
{
- CPDF_Object* pClone = pRef->GetDirect()->Clone();
- if(!pClone)
+ CPDF_Object* pClone = NULL;
Tom Sepez 2014/09/08 17:36:20 nit: maybe this reads clearer. Your call. CPDF_O
+ CPDF_Object* pDirect = pRef->GetDirect();
+ if (pDirect) {
+ pClone = pDirect->Clone();
+ }
+ if(!pClone) {
return 0;
+ }
if(pClone->GetType() == PDFOBJ_DICTIONARY)
{
« 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