mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
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.
This commit is contained in:
parent
495aaa295c
commit
290c9541de
Notes:
sideshowbarker
2024-07-17 09:37:30 +09:00
Author: https://github.com/nico
Commit: 290c9541de
Pull-request: https://github.com/SerenityOS/serenity/pull/23639
1 changed files with 0 additions and 0 deletions
BIN
Tests/LibPDF/jbig2-globals.pdf
Normal file
BIN
Tests/LibPDF/jbig2-globals.pdf
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue