Skip to content

Commit

Permalink
Fix performance problem in fuzzer.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbackhouse authored and neheb committed Apr 30, 2024
1 parent 3682a92 commit d239f14
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions fuzz/fuzz-read-print-write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,22 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {

image->readMetadata();
for (auto& md : image->exifData()) {
md.print();
md.print(&image->exifData());
if (md.tagName().substr(0, 2) != "0x") {
md.print();
md.print(&image->exifData());
}
}
for (auto& md : image->iptcData()) {
md.print();
md.print(&image->exifData());
if (md.tagName().substr(0, 2) != "0x") {
md.print();
md.print(&image->exifData());
}
}
for (auto& md : image->xmpData()) {
md.print();
md.print(&image->exifData());
if (md.tagName().substr(0, 2) != "0x") {
md.print();
md.print(&image->exifData());
}
}

// Print to a std::ostringstream so that the fuzzer doesn't
Expand Down

0 comments on commit d239f14

Please sign in to comment.