1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:38:12 +00:00
serenity/Userland/Libraries/LibPDF
Nico Weber fe3612ebcb LibPDF: Fix off-by-one in Reader
With this, looking at page 2 of pdf_reference_1-7.pdf no longer crashes.

Why did it crash in the first place? Because due to this bug, CFF.cpp
failed to parse the font program for the font used to render the `®`
character. `Renderer::render()` adds all errors that are encounterd
to an `errors` object but continues rendering. That meant that the
previous font was still active, and that didn't have a width for that
symbol in its width table.

SimpleFont::draw_string() falls back to get_glyph_width() if there's
no entry for a character for a symbol. `Type1Font::get_glyph_width()`
always dereferences `m_font` in that method, even if the font has
a font program (and m_font is hence nullptr).

With the off-by-one fixed, the second font is successfully installed
as current font, and the second font has a width entry for that symbol,
so the problem no longer occurs.
2023-07-12 14:19:14 -04:00
..
Fonts LibPDF: Remove an unused variable 2023-07-12 19:02:56 +02:00
CMakeLists.txt LibPDF: Refactor *Font classes 2023-02-24 20:16:50 +01:00
ColorSpace.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
ColorSpace.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
CommonNames.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
CommonNames.h LibPDF: Add support for AESV2 encryption 2023-07-12 06:28:15 +02:00
Document.cpp LibPDF: Make PDF version accessible on Document 2023-07-11 13:49:17 -04:00
Document.h LibPDF: Make PDF version accessible on Document 2023-07-11 13:49:17 -04:00
DocumentParser.cpp LibPDF: Make encrypted object streams work 2023-07-12 17:16:25 +02:00
DocumentParser.h LibPDF: Make PDF version accessible on Document 2023-07-11 13:49:17 -04:00
Encoding.cpp LibPDF: Avoid unnecessary HashMap copy, mark other copies 2023-05-19 22:33:57 +02:00
Encoding.h LibPDF: Add char_code -> name mapping function 2023-02-08 19:47:15 +01:00
Encryption.cpp LibPDF: Add support for AESV2 encryption 2023-07-12 06:28:15 +02:00
Encryption.h LibPDF: Add support for AESV2 encryption 2023-07-12 06:28:15 +02:00
Error.h LibPDF: Mark PDF::Error nodiscard 2023-07-12 17:03:14 +02:00
Filter.cpp Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01: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 AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
ObjectDerivatives.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
Operator.h Everywhere: Remove unused DeprecatedString includes 2023-04-09 22:00:54 +02:00
Parser.cpp LibPDF: Do not crash on encrypted files that start unluckily 2023-07-12 06:28:15 +02:00
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: Fix off-by-one in Reader 2023-07-12 14:19:14 -04:00
Reference.h LibPDF: Make Reference store two u32s instead of one 2023-07-10 17:48:15 +01:00
Renderer.cpp LibPDF: Scale vector paths with the view 2023-03-25 16:27:30 -06:00
Renderer.h LibPDF: Allow show_text to return errors 2023-02-24 20:16:50 +01: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