Using the PDF file testfile.pdf, the following MWE triggers a segmentation fault:
{
PdfMemDocument document;
document.Load("path/to/the/above/testfile.pdf");
PdfMemDocument otherdoc;
// otherdoc.Load("some/other/file.pdf"); // This is actually not needed to get the crash
document.GetPages().AppendDocumentPages(otherdoc);
document.GetMetadata().SetProducer("Anything");
document.Save("output.pdf");
}
It runs fine if you comment out either document.GetPages().AppendDocumentPages(otherdoc); or document.GetMetadata().SetProducer("Anything");.
Note: the test pdf has been created using pdftk.
Expected behaviour
Append the pages and set the Producer as expected (or raise an exception if the PDF file is malformed), without Segfaulting.
PoDoFo Version
Latest master (8690ee9)