mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:57:35 +00:00
LibPDF: Don't assert on outline destinations that use null
as page
Nothing in PDF 1.7 spec 8.2.1 Destinations mentions the page being `null`, but it happens in 0000372.pdf (for the root outline element) and in 0000776.pdf (for every outline element, which looks like a bug in the generator maybe) of 0000.zip from the pdfa dataset.
This commit is contained in:
parent
2e23f00a2f
commit
6d47fca3bf
1 changed files with 4 additions and 0 deletions
|
@ -418,6 +418,10 @@ PDFErrorOr<void> Document::build_outline()
|
||||||
PDFErrorOr<Destination> Document::create_destination_from_parameters(NonnullRefPtr<ArrayObject> array, HashMap<u32, u32> const& page_number_by_index_ref)
|
PDFErrorOr<Destination> Document::create_destination_from_parameters(NonnullRefPtr<ArrayObject> array, HashMap<u32, u32> const& page_number_by_index_ref)
|
||||||
{
|
{
|
||||||
auto page_ref = array->at(0);
|
auto page_ref = array->at(0);
|
||||||
|
|
||||||
|
if (page_ref.has<nullptr_t>())
|
||||||
|
return Destination { Destination::Type::XYZ, {}, {} };
|
||||||
|
|
||||||
auto type_name = TRY(array->get_name_at(this, 1))->name();
|
auto type_name = TRY(array->get_name_at(this, 1))->name();
|
||||||
|
|
||||||
Vector<Optional<float>> parameters;
|
Vector<Optional<float>> parameters;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue