Fuzzers: Continue if frame is malformed in GIF fuzzer

This commit is contained in:
Tim Ledbetter 2024-01-17 20:10:41 +00:00 committed by Andreas Kling
parent 4173a9880f
commit 45181e8eaf
Notes: sideshowbarker 2024-07-17 00:25:35 +09:00

View file

@ -30,9 +30,14 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
dbgln_if(GIF_DEBUG, "loop_count: {}", gif_decoder.loop_count());
dbgln_if(GIF_DEBUG, "frame_count: {}", gif_decoder.frame_count());
for (size_t i = 0; i < gif_decoder.frame_count(); ++i) {
auto ifd = gif_decoder.frame(i).release_value_but_fixme_should_propagate_errors();
dbgln_if(GIF_DEBUG, "frame #{} size: {}", i, ifd.image->size());
dbgln_if(GIF_DEBUG, "frame #{} duration: {}", i, ifd.duration);
auto ifd_or_error = gif_decoder.frame(i);
if (ifd_or_error.is_error()) {
dbgln_if(GIF_DEBUG, "frame #{} error: {}", i, ifd_or_error.release_error());
} else {
auto ifd = ifd_or_error.release_value();
dbgln_if(GIF_DEBUG, "frame #{} size: {}", i, ifd.image->size());
dbgln_if(GIF_DEBUG, "frame #{} duration: {}", i, ifd.duration);
}
}
dbgln_if(GIF_DEBUG, "Done.");
}