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

Unified Diff: third_party/sfntly/fuzzers/subset_font_fuzzer.cc

Issue 2308443002: Make FuzzedDataProvider vend std::strings (Closed)
Patch Set: thestig review Created 4 years, 2 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 | « third_party/WebKit/Source/platform/testing/FuzzedDataProvider.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sfntly/fuzzers/subset_font_fuzzer.cc
diff --git a/third_party/sfntly/fuzzers/subset_font_fuzzer.cc b/third_party/sfntly/fuzzers/subset_font_fuzzer.cc
index 08383e19c8420d030e6f2342884ccf470de725fa..e86d751887cbffe798b1d66f449662558ee89420 100644
--- a/third_party/sfntly/fuzzers/subset_font_fuzzer.cc
+++ b/third_party/sfntly/fuzzers/subset_font_fuzzer.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <cstdint>
+#include <string>
#include "base/test/fuzzed_data_provider.h"
#include "third_party/sfntly/src/cpp/src/sample/chromium/font_subsetter.h"
@@ -13,14 +14,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
base::FuzzedDataProvider fuzzed_data(data, size);
size_t font_name_size = fuzzed_data.ConsumeUint32InRange(0, kMaxFontNameSize);
- base::StringPiece font_name = fuzzed_data.ConsumeBytes(font_name_size);
+ std::string font_name = fuzzed_data.ConsumeBytes(font_name_size);
size_t font_str_size = fuzzed_data.ConsumeUint32InRange(0, kMaxFontSize);
- base::StringPiece font_str = fuzzed_data.ConsumeBytes(font_str_size);
+ std::string font_str = fuzzed_data.ConsumeBytes(font_str_size);
const unsigned char* font_data =
reinterpret_cast<const unsigned char*>(font_str.data());
- base::StringPiece glyph_ids_str = fuzzed_data.ConsumeRemainingBytes();
+ std::string glyph_ids_str = fuzzed_data.ConsumeRemainingBytes();
const unsigned int* glyph_ids =
reinterpret_cast<const unsigned int*>(glyph_ids_str.data());
size_t glyph_ids_size =
« no previous file with comments | « third_party/WebKit/Source/platform/testing/FuzzedDataProvider.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698