mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibPDF: Fix bad resolve_to calls in Document
We can't call resolve_to with IndirectValue{,Ref}, since the values will obviously be resolved, and will not give us the object of the correct type.
This commit is contained in:
parent
4479c1bff0
commit
309105678b
Notes:
sideshowbarker
2024-07-18 17:51:08 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/309105678b6 Pull-request: https://github.com/SerenityOS/serenity/pull/7018 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/bcoles Reviewed-by: https://github.com/tomuta
1 changed files with 2 additions and 2 deletions
|
@ -148,7 +148,7 @@ void Document::add_page_tree_node_to_page_tree(NonnullRefPtr<DictObject> page_tr
|
|||
// these pages to the overall page tree
|
||||
|
||||
for (auto& value : *kids_array) {
|
||||
auto reference = resolve_to<IndirectValueRef>(value);
|
||||
auto reference = object_cast<IndirectValueRef>(value.as_object());
|
||||
auto byte_offset = m_xref_table.byte_offset_for_object(reference->index());
|
||||
auto maybe_page_tree_node = m_parser.conditionally_parse_page_tree_node_at_offset(byte_offset);
|
||||
if (maybe_page_tree_node) {
|
||||
|
@ -163,7 +163,7 @@ void Document::add_page_tree_node_to_page_tree(NonnullRefPtr<DictObject> page_tr
|
|||
|
||||
// We know all of the kids are leaf nodes
|
||||
for (auto& value : *kids_array) {
|
||||
auto reference = resolve_to<IndirectValueRef>(value);
|
||||
auto reference = object_cast<IndirectValueRef>(value.as_object());
|
||||
m_page_object_indices.append(reference->index());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue