mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
FuzzPDF: Initialize document so page count is accurate
Without calling `initialize()`, the page count is 0, so the loop never ran and we never actually tested any of the code in `get_page()`.
This commit is contained in:
parent
5028223c37
commit
bf1d680a75
1 changed files with 1 additions and 0 deletions
|
@ -13,6 +13,7 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||||
|
|
||||||
if (auto maybe_document = PDF::Document::create(bytes); !maybe_document.is_error()) {
|
if (auto maybe_document = PDF::Document::create(bytes); !maybe_document.is_error()) {
|
||||||
auto document = maybe_document.release_value();
|
auto document = maybe_document.release_value();
|
||||||
|
(void)document->initialize();
|
||||||
auto pages = document->get_page_count();
|
auto pages = document->get_page_count();
|
||||||
for (size_t i = 0; i < pages; ++i) {
|
for (size_t i = 0; i < pages; ++i) {
|
||||||
(void)document->get_page(i);
|
(void)document->get_page(i);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue