Commit 870878a5 authored by Daniel Hosseinian's avatar Daniel Hosseinian Committed by Commit Bot

Remove sfntly_fuzzer

In preparation of sfntly's replacement by HarfBuzz, remove
sfntly_fuzzer. Any issues found by ClusterFuzz are unlikely to be
fixed.

Bug: 931719, 1009078
Change-Id: Ia0e3661afc5d92b57b16bf1e4fb4e4cc00b8783f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1853844
Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Abhishek Arya <inferno@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarAbhishek Arya <inferno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704804}
parent 30ab877e
......@@ -2,8 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//testing/libfuzzer/fuzzer_test.gni")
declare_args() {
# Flip to true to build sfntly sample programs.
build_sfntly_samples = false
......@@ -165,17 +163,6 @@ static_library("sfntly") {
]
}
fuzzer_test("sfntly_fuzzer") {
sources = [
"fuzzers/subset_font_fuzzer.cc",
]
deps = [
":sfntly",
"//base/test:test_support",
]
seed_corpus = "fuzzers/corpora/sfntly_fuzzer"
}
if (build_sfntly_samples) {
source_set("sfntly_subtly") {
sources = [
......
include_rules = [
"+base",
]
// Copyright 2016 The Chromimum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stddef.h>
#include <stdint.h>
#include <fuzzer/FuzzedDataProvider.h>
#include <string>
#include <vector>
#include "third_party/sfntly/src/cpp/src/sample/chromium/font_subsetter.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
constexpr int kMaxFontNameSize = 128;
constexpr int kMaxFontSize = 50 * 1024 * 1024;
FuzzedDataProvider fuzzed_data(data, size);
size_t font_name_size =
fuzzed_data.ConsumeIntegralInRange(0, kMaxFontNameSize);
std::string font_name = fuzzed_data.ConsumeBytesAsString(font_name_size);
size_t font_str_size = fuzzed_data.ConsumeIntegralInRange(0, kMaxFontSize);
std::vector<unsigned char> font_str =
fuzzed_data.ConsumeBytes<unsigned char>(font_str_size);
std::vector<uint8_t> glyph_ids_str =
fuzzed_data.ConsumeRemainingBytes<uint8_t>();
const unsigned int* glyph_ids =
reinterpret_cast<const unsigned int*>(glyph_ids_str.data());
size_t glyph_ids_size = glyph_ids_str.size() *
sizeof(decltype(glyph_ids_str)::value_type) /
sizeof(*glyph_ids);
unsigned char* output = nullptr;
SfntlyWrapper::SubsetFont(font_name.c_str(), font_str.data(), font_str.size(),
glyph_ids, glyph_ids_size, &output);
delete[] output;
return 0;
}
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