From fbd00d9c8ed80bd23ed53e486089133e9936606a Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 20 Oct 2023 23:20:18 -0400 Subject: [PATCH] LibPDF: Use resolve_to on /Dests entry Fixes an assertion if /Dests is an indirect object (`24 0 R`) instead of an inline dictionary. --- Userland/Libraries/LibPDF/Document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibPDF/Document.cpp b/Userland/Libraries/LibPDF/Document.cpp index 00d3d51b32..62989271e4 100644 --- a/Userland/Libraries/LibPDF/Document.cpp +++ b/Userland/Libraries/LibPDF/Document.cpp @@ -502,7 +502,7 @@ PDFErrorOr Document::create_destination_from_object(NonnullRefPtrcast()->string(); if (auto dests_value = m_catalog->get(CommonNames::Dests); dests_value.has_value()) { - auto dests = dests_value.value().get>()->cast(); + auto dests = TRY(resolve_to(dests_value.value())); auto entry = MUST(dests->get_object(this, dest_name)); return TRY(create_destination_from_dictionary_entry(entry, page_number_by_index_ref)); }