mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
LibPDF: Don't crash on encrypted files with streams with filter arrays
Makes it possible to render more than 0 pages of CIPA_DC-003-2020_E.pdf
This commit is contained in:
parent
532230c0e4
commit
af5a7b9a51
|
@ -676,8 +676,10 @@ void StandardSecurityHandler::crypt(NonnullRefPtr<Object> object, Reference refe
|
|||
};
|
||||
|
||||
if (stream->dict()->contains(CommonNames::Filter)) {
|
||||
auto filter = stream->dict()->get_name(m_document, CommonNames::Filter).release_value_but_fixme_should_propagate_errors()->name();
|
||||
if (filter == "Crypt")
|
||||
// ISO 32000 (PDF 2.0), 7.4.10 Crypt filter
|
||||
// "The Crypt filter shall be the first filter in the Filter array entry."
|
||||
auto filters = m_document->read_filters(stream->dict()).release_value_but_fixme_should_propagate_errors();
|
||||
if (!filters.is_empty() && filters[0] == "Crypt")
|
||||
TODO();
|
||||
}
|
||||
} else if (object->is<StringObject>()) {
|
||||
|
|
Loading…
Reference in a new issue