summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorJulian Offenhäuser <offenhaeuser@protonmail.com>2023-02-11 20:55:32 +0100
committerLinus Groh <mail@linusgroh.de>2023-02-12 10:55:37 +0000
commit96064ec5af423bd8014452f078e387821cc2ead9 (patch)
treef31828259a74b46cb12ac29427c789dacf14f349 /Userland/Libraries
parent34350ee9e7355a564fc94a1bf9e7aac8763ae89a (diff)
downloadserenity-96064ec5af423bd8014452f078e387821cc2ead9.zip
LibPDF: Allow filter DecodeParms array entries to be null
Filters will use the default values in this case.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibPDF/Parser.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibPDF/Parser.cpp b/Userland/Libraries/LibPDF/Parser.cpp
index 374230a49b..1c7df04511 100644
--- a/Userland/Libraries/LibPDF/Parser.cpp
+++ b/Userland/Libraries/LibPDF/Parser.cpp
@@ -495,8 +495,10 @@ PDFErrorOr<NonnullRefPtr<StreamObject>> Parser::parse_stream(NonnullRefPtr<DictO
if (decode_parms_object->is<ArrayObject>()) {
auto decode_parms_array = decode_parms_object->cast<ArrayObject>();
for (size_t i = 0; i < decode_parms_array->size(); ++i) {
- // FIXME: This entry may be the null object instead
- RefPtr<DictObject> decode_parms = decode_parms_array->at(i).get<NonnullRefPtr<Object>>()->cast<DictObject>();
+ RefPtr<DictObject> decode_parms;
+ auto entry = decode_parms_array->at(i);
+ if (entry.has<NonnullRefPtr<Object>>())
+ decode_parms = entry.get<NonnullRefPtr<Object>>()->cast<DictObject>();
decode_parms_vector.append(decode_parms);
}
} else {