Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3929)

Unified Diff: base/test/fuzzed_data_provider.cc

Issue 2268863003: Add a fuzzer for SfntlyWrapper::SubsetFont(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test corpus Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/sfntly/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/fuzzed_data_provider.cc
diff --git a/base/test/fuzzed_data_provider.cc b/base/test/fuzzed_data_provider.cc
index 5ea5862052a7fed7034d4e367e4a24c35f13788b..f2d4e0a468512d363ab400399ad5dbf8e3a17cb6 100644
--- a/base/test/fuzzed_data_provider.cc
+++ b/base/test/fuzzed_data_provider.cc
@@ -34,7 +34,7 @@ uint32_t FuzzedDataProvider::ConsumeUint32InRange(uint32_t min, uint32_t max) {
uint32_t offset = 0;
uint32_t result = 0;
- while ((range >> offset) > 0 && !remaining_data_.empty()) {
+ while (offset < 32 && (range >> offset) > 0 && !remaining_data_.empty()) {
// Pull bytes off the end of the seed data. Experimentally, this seems to
// allow the fuzzer to more easily explore the input space. This makes
// sense, since it works by modifying inputs that caused new code to run,
« no previous file with comments | « no previous file | third_party/sfntly/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698