1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00
serenity/Userland/Libraries/LibPDF
Nico Weber 02d2d12592 LibPDF: Allow moving Reader::move_to() to end of data stream
CFF::parse_index_data() calls move_to() to put the reader's
current position behind the index data.

In several PDFs, the PrivDictOperator::Subrs case in CFF::create()
sets up a span that contains exactly the Subrs data and nothing
after it, so that finale move_to() call in parse_index_data()
would cause an assert.

This is similar to fe3612ebcb, where the caller was also in CFF.
So maybe CFF just has a different view of what valid values to pass
to Reader are, compared to the rest of the code? But having an iterator
point to one past the valid data in a container is common, so maybe
this is the Right Fix after all.

Fixes a crash opening 411_getting_started_with_instruments.pdf
(and a whole bunch of other WWDC slides). Rendering is pretty glitchy
and we still crash on page 14, but at least we can open the file now.

The file is currently available at:
411cbc60y12x68arcof/411/411_getting_started_with_instruments.pdf
2023-10-18 06:32:23 -04:00
..
Fonts LibPDF: Read Global subr data in CFF reader 2023-10-18 11:02:10 +02:00
CMakeLists.txt LibPDF: Move code to compute full page contents into Page 2023-07-12 18:22:35 -04:00
ColorSpace.cpp LibPDF: Dedicated messages for Indexed and Pattern spaces 2023-07-24 11:01:25 -04:00
ColorSpace.h LibPDF: Add smoke-and-mirror implementation of SeparationColorSpace 2023-07-24 09:52:01 -04:00
CommonNames.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
CommonNames.h LibPDF: Implement GoTo action for outline 2023-10-18 06:29:02 -04:00
Document.cpp LibPDF: Implement GoTo action for outline 2023-10-18 06:29:02 -04:00
Document.h LibPDF: Extract a create_destination_from_object() function 2023-10-18 06:29:02 -04:00
DocumentParser.cpp LibPDF: Fix incorrectly parsing subsections in xref stream 2023-07-18 00:51:23 +02:00
DocumentParser.h LibPDF: Make PDF version accessible on Document 2023-07-11 13:49:17 -04:00
Encoding.cpp LibPDF: Add two FIXMEs 2023-10-13 07:53:27 +02:00
Encoding.h LibPDF: Add char_code -> name mapping function 2023-02-08 19:47:15 +01:00
Encryption.cpp LibPDF: Don't crash on encrypted files with streams with filter arrays 2023-07-24 09:50:45 -04:00
Encryption.h LibPDF: Implement 7.6.4.3.3 Algorithm 2.A: Retrieve file encryption key 2023-07-21 11:55:20 +02:00
Error.h LibPDF: Mark PDF::Error nodiscard 2023-07-12 17:03:14 +02:00
Filter.cpp LibPDF: Make JPEG decoding errors not assert 2023-07-23 23:04:25 -04:00
Filter.h LibPDF: Improve error support for Filter class 2023-03-02 12:18:53 +01:00
Forward.h Everywhere: Remove unused includes of AK/StdLibExtras.h 2023-01-02 20:27:20 -05:00
Interpolation.cpp LibPDF: Add first interpolation methods 2022-12-10 10:49:03 +01:00
Interpolation.h LibPDF: Add first interpolation methods 2022-12-10 10:49:03 +01:00
Object.h LibPDF: Make Object::cast<T>() non-const 2023-02-21 00:54:04 +01:00
ObjectDerivatives.cpp LibPDF: Fix quadratic runtime in stream dumping 2023-07-14 09:50:30 -04:00
ObjectDerivatives.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
Operator.h LibPDF: Fix symbol for text_next_line_show_string_set_spacing operator 2023-07-22 12:25:30 -04:00
Page.cpp LibPDF: Tweak Page::page_contents() implementation for brevity 2023-07-12 18:22:35 -04:00
Page.h LibPDF: Move code to compute full page contents into Page 2023-07-12 18:22:35 -04:00
Parser.cpp AK+Everywhere: Remove the null state of DeprecatedString 2023-10-13 18:33:21 +03:30
Parser.h LibPDF: Make encrypted object streams work 2023-07-12 17:16:25 +02:00
Reader.cpp LibPDF: Don't consume anything other than EOL in Reader::consume_eol() 2023-03-22 09:04:00 +01:00
Reader.h LibPDF: Allow moving Reader::move_to() to end of data stream 2023-10-18 06:32:23 -04:00
Reference.h LibPDF: Make Reference store two u32s instead of one 2023-07-10 17:48:15 +01:00
Renderer.cpp LibPDF: Cache fonts per page 2023-10-11 07:10:19 +02:00
Renderer.h LibPDF: Cache fonts per page 2023-10-11 07:10:19 +02:00
Value.cpp Everywhere: Stop shoving things into ::std and mentioning them as such 2022-12-14 11:44:32 +01:00
Value.h Everywhere: Stop shoving things into ::std and mentioning them as such 2022-12-14 11:44:32 +01:00
XRefTable.h LibPDF: Allow reading documents with incremental updates 2023-02-12 10:55:37 +00:00