mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
LibPDF: Don't crash on images with empty filter arrays
0000967.pdf page 2 contains a bunch of inline images with empty filter arrays.
This commit is contained in:
parent
13641693cb
commit
b21f867e88
1 changed files with 2 additions and 0 deletions
|
@ -890,6 +890,8 @@ PDFErrorOr<NonnullRefPtr<Gfx::Bitmap>> Renderer::load_image(NonnullRefPtr<Stream
|
|||
if (filter_object->is<NameObject>())
|
||||
return filter_object->cast<NameObject>()->name() == name;
|
||||
auto filters = filter_object->cast<ArrayObject>();
|
||||
if (filters->elements().is_empty())
|
||||
return false;
|
||||
auto last_filter_index = filters->elements().size() - 1;
|
||||
return MUST(filters->get_name_at(m_document, last_filter_index))->name() == name;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue