ladybird/Userland
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 ead02da98ac70c ("/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
..
Applets Keymap: Draw the current keymap text with the correct theme color 2024-03-02 19:24:53 +00:00
Applications AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
BuggieBox AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
Demos AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
DevTools AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
DynamicLoader DynamicLoader: Disable stack protector in some files for RISC-V 2024-03-04 01:44:11 +01:00
Games AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
Libraries LibPDF: Handle indirect reference resolving during parsing more robustly 2024-03-19 19:20:01 -04:00
Services LibWeb: Add basic implementation of has_a_rendering_opportunity() 2024-03-19 07:54:14 +01:00
Shell AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
Utilities AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
CMakeLists.txt Userland: Add the BuggieBox program 2022-11-26 12:41:47 -07:00