1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 04:44:24 +00:00
serenity/Tests/LibPDF/jbig2-globals.pdf
Nico Weber 290c9541de Tests/LibPDF: Add a test for resolving indirect refs during parsing
This test uses a JBIG2Globals with an indirect reference,
and contains an indirect reference for a stream length.
When we parse the main JBIG2 image's stream, we unfilter
its data, which causes these two indirect references to
be resolved during parsing.

I started with the output of

    Meta/jbig2_to_pdf.py -o foo.pdf \
        Tests/LibGfx/test-inputs/jbig2/bitmap.jbig2

and then manually added a

    /DecodeParms <</JBIG2Globals 6 0 R>>

entry pointing to an empty stream, and made that new stream
object's length an indirect reference too for good measure.

I used `mutool clean` to fix up offsets a bit. But that also
removes the indirect reference for a stream's length, so I
manually put that back in and adjusted the offset to the last
object in the xref table and the startxref value.
2024-03-19 19:20:01 -04:00

1.1 KiB