1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:37:34 +00:00

LibPDF: Propagate errors in Parser and Document

This commit is contained in:
Matthew Olsson 2022-03-05 17:30:55 -07:00 committed by Andreas Kling
parent 7e1c823725
commit 73cf8205b4
16 changed files with 472 additions and 420 deletions

View file

@ -10,12 +10,12 @@
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
ReadonlyBytes bytes { data, size };
auto doc = PDF::Document::create(bytes);
if (doc) {
auto pages = doc->get_page_count();
if (auto maybe_document = PDF::Document::create(bytes); !maybe_document.is_error()) {
auto document = maybe_document.release_value();
auto pages = document->get_page_count();
for (size_t i = 0; i < pages; ++i) {
(void)doc->get_page(i);
(void)document->get_page(i);
}
}