Treat null Parent as no Parent for dictionary objects
[pdfium.git] / fpdfsdk / src / fpdfppo.cpp
index 032c3db..b8d2125 100644 (file)
@@ -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;
        }