summaryrefslogtreecommitdiffstats
path: root/modules/woff2/src/convert_woff2ttf_fuzzer_new_entry.cc
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-11-14 10:02:36 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-11-14 10:02:36 +0100
commit36975f3865948f3faa959fe386e58b22783bd379 (patch)
tree890182161b3e522f45f966574425d85972bff4a5 /modules/woff2/src/convert_woff2ttf_fuzzer_new_entry.cc
parent787b4fe586456565c2dda457ad81f1dd420e9249 (diff)
downloadUXP-36975f3865948f3faa959fe386e58b22783bd379.tar
UXP-36975f3865948f3faa959fe386e58b22783bd379.tar.gz
UXP-36975f3865948f3faa959fe386e58b22783bd379.tar.lz
UXP-36975f3865948f3faa959fe386e58b22783bd379.tar.xz
UXP-36975f3865948f3faa959fe386e58b22783bd379.zip
Issue #1288 - Part 3: Update woff2 component to 1.0.2
Diffstat (limited to 'modules/woff2/src/convert_woff2ttf_fuzzer_new_entry.cc')
-rw-r--r--modules/woff2/src/convert_woff2ttf_fuzzer_new_entry.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/woff2/src/convert_woff2ttf_fuzzer_new_entry.cc b/modules/woff2/src/convert_woff2ttf_fuzzer_new_entry.cc
new file mode 100644
index 000000000..5ad93364b
--- /dev/null
+++ b/modules/woff2/src/convert_woff2ttf_fuzzer_new_entry.cc
@@ -0,0 +1,12 @@
+#include <string>
+#include <woff2/decode.h>
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t data_size) {
+ // Decode using newer entry pattern.
+ // Same pattern as woff2_decompress.
+ std::string output(std::min(woff2::ComputeWOFF2FinalSize(data, data_size),
+ woff2::kDefaultMaxSize), 0);
+ woff2::WOFF2StringOut out(&output);
+ woff2::ConvertWOFF2ToTTF(data, data_size, &out);
+ return 0;
+}