From 4cf36954a1676e103f899bee0138610c76500b42 Mon Sep 17 00:00:00 2001 From: Jun Fang Date: Mon, 8 Sep 2014 11:27:02 -0700 Subject: The cause of this issue is that there is an indirect object like '112 0 R' but no its direct object '112 0 object' in the test pdf file. Without checking the validity, it causes a null pointer when trying to get the direct object by an indirect object. BUG=390781 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/553613003 --- fpdfsdk/src/fpdfppo.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp index b8d2125b7d..a5c4275648 100644 --- a/fpdfsdk/src/fpdfppo.cpp +++ b/fpdfsdk/src/fpdfppo.cpp @@ -313,9 +313,17 @@ int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPt } else { - CPDF_Object* pClone = pRef->GetDirect()->Clone(); - if(!pClone) + CPDF_Object* pDirect = pRef->GetDirect(); + if(!pDirect) + { + return 0; + } + + CPDF_Object* pClone = pDirect->Clone(); + if(!pClone) + { return 0; + } if(pClone->GetType() == PDFOBJ_DICTIONARY) { -- cgit v1.2.3