Commit f45c2a25 authored by Calder Kitagawa's avatar Calder Kitagawa Committed by Commit Bot

[Zucchini] Fix patch size check in fuzzer

The fuzzer found another pathological case of repeated ZTF regions that
causes the patch size check to be violated due to a large number of
headers. The solution should be to increase this upper bound or remove
it entirely. I've gone with the former but if it continues to cause
trouble it might be worth removing as it only finds pathological cases
so far.

Bug: 860070
Change-Id: I276b51bc909ad0da46d9954aee9c98e03dc1973e
Reviewed-on: https://chromium-review.googlesource.com/1126164Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572581}
parent 26fa7866
...@@ -63,7 +63,7 @@ DEFINE_BINARY_PROTO_FUZZER(const zucchini::fuzzers::FilePair& file_pair) { ...@@ -63,7 +63,7 @@ DEFINE_BINARY_PROTO_FUZZER(const zucchini::fuzzers::FilePair& file_pair) {
// as it is a failure in Zucchini's patch performance that is worth // as it is a failure in Zucchini's patch performance that is worth
// investigating. // investigating.
size_t patch_size = patch_writer.SerializedSize(); size_t patch_size = patch_writer.SerializedSize();
CHECK_LE(patch_size, kMaxImageSize * 2); CHECK_LE(patch_size, kMaxImageSize * 3);
// Write to buffer to avoid IO. // Write to buffer to avoid IO.
std::unique_ptr<uint8_t[]> patch_data(new uint8_t[patch_size]); std::unique_ptr<uint8_t[]> patch_data(new uint8_t[patch_size]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment