serenity/Tests/LibPDF
Nico Weber 0374c1eb3b LibPDF: Handle indirect reference resolving during parsing more robustly
If `Document::resolve()` was called during parsing, it'd change the
reader's current position, so the parsing code that called it would
then end up at an unexpected position in the file.

Parser.cpp already had special-case recovery when a stream's length
was stored in an indirect reference.

Commit ead02da98a ("/JBIG2Globals") in #23503 added another case
where we could resolve indirect reference during parsing, but wasn't
aware of having to save and restore the reader position for that.

Put the save/restore code in `DocumentParser::parse_object_with_index`
instead, right before the place that ultimately changes the reader's
position during `Document::resolve`. This fixes `/JBIG2Globals` and
lets us remove the special-case code for `/Length` handling.

Since this is kind of subtle, include a test.
2024-03-19 19:20:01 -04:00
..
BenchmarkPDF.cpp Tests/LibPDF: Add a benchmark for SampledFunction::evaluate() 2024-02-13 19:45:19 +01:00
CMakeLists.txt LibPDF: Handle indirect reference resolving during parsing more robustly 2024-03-19 19:20:01 -04:00
colorspaces.pdf Tests: Add a pdf file for testing color spaces 2023-11-04 17:02:37 -04:00
complex.pdf Tests: Move test PDF files into Tests/LibPDF 2023-01-19 11:50:10 +00:00
encoding.pdf LibPDF: Add (automated!) test for outline encoding 2023-11-22 09:08:06 -07:00
encryption_nocopy.pdf LibPDF: Make encrypted object streams work 2023-07-12 17:16:25 +02:00
jbig2-globals.pdf Tests/LibPDF: Add a test for resolving indirect refs during parsing 2024-03-19 19:20:01 -04:00
linearized.pdf Tests: Move test PDF files into Tests/LibPDF 2023-01-19 11:50:10 +00:00
non-linearized.pdf Tests: Move test PDF files into Tests/LibPDF 2023-01-19 11:50:10 +00:00
oss-fuzz-testcase-62065.pdf LibPDF: Don't use unsanitized values in error messages 2023-10-26 11:05:32 +02:00
password-is-sup.pdf Tests/LibPDF: Add test for AES-encrypted PDF 2023-07-12 06:28:15 +02:00
pattern.pdf Tests: Add a test for LibPDF pattern rendering 2023-12-10 16:44:24 +01:00
rotate.pdf Tests: Add a pdf with text rotation 2024-01-18 14:01:30 +01:00
standard-14-fonts.pdf Tests/LibPDF: Make standard-14-fonts.pdf 200 units less high 2024-02-27 17:42:08 -05:00
TestPDF.cpp LibPDF: Handle indirect reference resolving during parsing more robustly 2024-03-19 19:20:01 -04:00
text.pdf Tests/LibPDF: Make text.pdf also use Tz, Tc, Tw, Ts operators 2024-01-18 14:01:30 +01:00
type1.pdf Tests: Move test PDF files into Tests/LibPDF 2023-01-19 11:50:10 +00:00
type3.pdf Tests: Add a type3 test pdf 2023-11-19 22:33:34 +01:00
wide-gamut-only.pdf Tests: Add a pdf that embeds a wide-gamut 16-bits/channel image 2024-01-12 16:20:46 -07:00