summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-08-12 11:10:51 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-08-12 11:10:51 -0700
commitd38a35ec7416a884de964014691777110093a931 (patch)
tree3e762bd35c9f13e75fc57876666ea83f10991ab9
parent9fa56b72aeaaa7c8e86d232797d887a4346af5ac (diff)
downloadpdfium-d38a35ec7416a884de964014691777110093a931.tar.xz
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
-rw-r--r--fpdfsdk/src/fpdfppo.cpp5
1 files changed, 4 insertions, 1 deletions
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;
}