Hi, Matthew, Am Donnerstag, den 10.05.2018, 18:26 +0200 schrieb Matthew Brincke: > [typos fixed and code re-wrapped in quote] > > Hello Georg, hello all, > > On 10 May 2018 at 16:14 Georg Funk <georgf...@hotmail.de> wrote: > > > > > > Dear developers, > > > > I'm getting a segmentation fault in the following code snippet when > > resolving IsReference()): > > > > if (objectVector.GetObject(currentReference)->IsReference()) { > > currentReference = objectVector > > .GetObject(currentReference)->GetReference(); > > } > > else {} > > > > objectVector is a global variable here and currentReference holds a > > PdfReference to look up. > > the method PdfVecObjects::GetObject() (your objectVector is of type > PdfVecObjects, right?) can return NULL (nullptr from C++11), this > means that the the reference passed (your currentReference) could > not be resolved (no object with those numbers was found in the > vector). > Then IsReference() would be called with NULL this (undefined > behaviour > AFAIK). >
Right, the objectVector is of the type PdfVecObjects. I try to pass the content object of each page to my data model, which has also function above, to build up a recursive Object-Tree. But it fails at the very first invocation. Georg ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users