From 6c56055f65fc5a64a6124929f6313892cea18fe0 Mon Sep 17 00:00:00 2001 From: Kevin Lubick Date: Wed, 20 Jun 2018 09:29:23 -0400 Subject: Update fuzz autodetect for other fuzzer aliases This allows for legacy "skjson" to still work and clusterfuzz's skia_pathops_fuzzer to be detected. Bug: skia:831647 Change-Id: I3b06e7b9095599e29f35af9ad14a1a8820fe64c5 Reviewed-on: https://skia-review.googlesource.com/136063 Reviewed-by: Florin Malita Commit-Queue: Kevin Lubick --- fuzz/fuzz.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'fuzz') diff --git a/fuzz/fuzz.cpp b/fuzz/fuzz.cpp index a71a386820..13b49b8c0f 100644 --- a/fuzz/fuzz.cpp +++ b/fuzz/fuzz.cpp @@ -224,9 +224,11 @@ static std::map cf_api_map = { {"api_raster_n32_canvas", "RasterN32Canvas"}, {"jpeg_encoder", "JPEGEncoder"}, {"png_encoder", "PNGEncoder"}, + {"skia_pathop_fuzzer", "Pathop"}, {"webp_encoder", "WEBPEncoder"} }; +// maps clusterfuzz/oss-fuzz -> Skia's name static std::map cf_map = { {"animated_image_decode", "animated_image_decode"}, {"image_decode", "image_decode"}, @@ -235,6 +237,7 @@ static std::map cf_map = { {"path_deserialize", "path_deserialize"}, {"region_deserialize", "region_deserialize"}, {"region_set_path", "region_set_path"}, + {"skjson", "json"}, {"textblob_deserialize", "textblob"} }; @@ -245,15 +248,10 @@ static SkString try_auto_detect(SkString path, SkString* name) { if (std::regex_search(path.c_str(), m, clusterfuzz)) { std::string type = m.str(2); - if (type.find("api_") != std::string::npos || type.find("_encoder") != std::string::npos) { - if (cf_api_map.find(type) != cf_api_map.end()) { - *name = SkString(cf_api_map[type].c_str()); //probably wrong - return SkString("api"); - } else { - SkDebugf("Unrecognized api name %s\n", type.c_str()); - print_api_names(); - return SkString(""); - } + + if (cf_api_map.find(type) != cf_api_map.end()) { + *name = SkString(cf_api_map[type].c_str()); + return SkString("api"); } else { if (cf_map.find(type) != cf_map.end()) { return SkString(cf_map[type].c_str()); -- cgit v1.2.3