diff -rupN podofo-0.9.6/src/doc/PdfPage.cpp podofo-0.9.6-new/src/doc/PdfPage.cpp --- podofo-0.9.6/src/doc/PdfPage.cpp 2018-03-11 20:40:59.000000000 +0100 +++ podofo-0.9.6-new/src/doc/PdfPage.cpp 2018-12-19 22:42:36.937103529 +0100 @@ -595,6 +595,13 @@ unsigned int PdfPage::GetPageNumber() co while( it != kids.end() && (*it).GetReference() != ref ) { PdfObject* pNode = this->GetObject()->GetOwner()->GetObject( (*it).GetReference() ); + if (!pNode) + { + std::ostringstream oss; + oss << "Object " << (*it).GetReference().ToString() << " not found from Kids array " + << pKids->Reference().ToString(); + PODOFO_RAISE_ERROR_INFO( ePdfError_NoObject, oss.str() ); + } if( pNode->GetDictionary().GetKey( PdfName::KeyType ) != NULL && pNode->GetDictionary().GetKey( PdfName::KeyType )->GetName() == PdfName( "Pages" ) )