The patch for ReadXRefSubsection in r1840 has broken PDFs that contain XRef subsections.
- At r1839 m_offsets.resize was only called if m_offsets needed to grow - At r1840 m_offsets.resize is always called which means it can shrink the m_offsets table and wipe out existing objects For http://heeen.de/test2-annotated.pdf then r1839 did this 1) PdfParser::ReadDocumentStructure resizes m_offsets table to 126 objects, then reads into m_offsets 2) Doesn’t resize m_offsets in PdfParser::ReadXRefSubsection (already big enough) 3) Doesn’t resize m_offsets in PdfParser::ReadXRefSubsection (already big enough) For http://heeen.de/test2-annotated.pdf then r1840 does this: 1) PdfParser::ReadDocumentStructure resizes m_offsets table to 126 objects, then reads into m_offsets 2) Resizes m_offsets to 1 in PdfParser::ReadXRefSubsection (this wipes out most of the objects) 3) Resizes m_offsets to 4 in PdfParser::ReadXRefSubsection The example in H.7.1 on page 712 of PDF32000_2008.pdf shows the problem – the first xref subsection has nFirstObject=0, nNumObjects=1, so ReadXRefSubsection calls m_offsets.resize(1) which wipes out the previously read objects (4, 7, 8, 9, 10 and 11) Best Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL On 02/06/2017, 11:55, "zyx" <z...@litepdf.cz> wrote: On Fri, 2017-06-02 at 11:58 +0200, Florian Hänel wrote: > WARNING: There are more objects (4) in this XRef table than specified > in the size key of the trailer directory (1)! > WARNING: There are more objects (126) in this XRef table than > specified in the size key of the trailer directory (4)! Hi, the file you have seems to be broken. Could you test with a valid and fully compliant PDF file, please? Bye, zyx -- http://www.litePDF.cz i...@litepdf.cz ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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