• After xref reconstruction treat the input file as suspect and apply sanity checks to all subsequent object reads.
    
    Remove `in_xref_reconstruction` flag and update references to use `reconstructed_xref` for simplified state management during xref processing. Adjust warnings for invalid dictionary keys in test output.
    m-holger authored
     
    Browse Dir »









  • ... containing objects with no white-space between them.
    
    To enforce the rule that objects end at the start-offset of the next
    object, each object is parsed in it own object stream.
    
    To facilitate this, a new private API input source is::OffsetBuffer has
    been added which only contains the object but reports offsets relative to
    the start of the object stream. This is adapted from OffsetInputSource by
    changing the direction of the offset, endowing it with its own
    BufferInputSource and striooing out checks duplicated in BufferInputSource.
    
    Fixes the expected failure in the test case added in #1266.
    m-holger authored
     
    Browse Dir »













  • Ghostscript 10.0.2 failed to handle the files changed in this commit,
    but ghostscript 10.0.4 handles them fine as do earlier versions. These
    files all have hybird xref in the form of a file with an xref table
    appended with a section that has an xref stream. They all have
    /PageLabels pointing to 107 0 R in the original file, with 107 higher
    than the highest object. The spec says that this should be treated as
    null, which results in /PageLabels null, which results in ghostscript
    errors in that version. While ghostscript 10.0.2 may be handling the
    file incorrectly, the file does something that's not really kosher,
    and it's easier to fix the files, which had not been changed since the
    very first open source release of qpdf, than to try to work around the
    issue.
    
    This was discovered with the GitHub actions runner was bumped to
    Ubuntu 24.04, which contains the buggy version of ghostscript. I was
    not able to find a specific ghostscript issue that addressed this, but
    the problem went away in either 10.0.3 or 10.0.4.
    
    Commenting out /PageLabels without changing offsets was a pragmatic
    move to avoid having to regenerate the xref tables manually. I just
    had to manually edit the binary xref stream to change the offset of
    one item (the new object 1), which I put at the end to avoid breaking
    other things.
    Jay Berkenbilt authored
     
    Browse Dir »