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
Notes:
sideshowbarker
2024-07-16 23:34:49 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/bf1d680a75 Pull-request: https://github.com/SerenityOS/serenity/pull/20193
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()) {
|
||||
auto document = maybe_document.release_value();
|
||||
(void)document->initialize();
|
||||
auto pages = document->get_page_count();
|
||||
for (size_t i = 0; i < pages; ++i) {
|
||||
(void)document->get_page(i);
|
||||
|
|
Loading…
Add table
Reference in a new issue