From d38a35ec7416a884de964014691777110093a931 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Tue, 12 Aug 2014 11:10:51 -0700 Subject: Treat null Parent as no Parent for dictionary objects To be complient with PDF reference chapter 7.3.7 BUG=402437 R=vitalybuka@chromium.org Review URL: https://codereview.chromium.org/469573002 --- fpdfsdk/src/fpdfppo.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp index 032c3dba39..b8d2125b7d 100644 --- a/fpdfsdk/src/fpdfppo.cpp +++ b/fpdfsdk/src/fpdfppo.cpp @@ -215,8 +215,11 @@ CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag(CPDF_Dictionary *pDic { if(pp->KeyExist((const char*)nSrctag)) return pp->GetElement((const char*)nSrctag); - else if(pp->KeyExist("Parent")) + else if (pp->KeyExist("Parent")) + { pp = (CPDF_Dictionary*)pp->GetElement("Parent")->GetDirect(); + if (pp->GetType() == PDFOBJ_NULL) break; + } else break; } -- cgit v1.2.3