Fuzz should observe the optional Skottie flag.
Change-Id: I41d79442559bc020ac786f668534f5a2990cc96f
Reviewed-on: https://skia-review.googlesource.com/126121
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index ec45729..4ce7625 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1843,7 +1843,6 @@
"fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
"fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
"fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
- "fuzz/oss_fuzz/FuzzSkottieJSON.cpp",
"fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
"tools/UrlDataManager.cpp",
"tools/debugger/SkDebugCanvas.cpp",
@@ -1859,6 +1858,10 @@
"//third_party/jsoncpp",
"//third_party/libpng",
]
+
+ if (skia_enable_skottie) {
+ sources += [ "fuzz/oss_fuzz/FuzzSkottieJSON.cpp" ]
+ }
}
test_app("pathops_unittest") {
diff --git a/fuzz/fuzz.cpp b/fuzz/fuzz.cpp
index c2a8ca0..9857e80 100644
--- a/fuzz/fuzz.cpp
+++ b/fuzz/fuzz.cpp
@@ -18,7 +18,6 @@
#include "SkPaint.h"
#include "SkPath.h"
#include "SkPicture.h"
-#include "Skottie.h"
#include "SkPipe.h"
#include "SkReadBuffer.h"
#include "SkStream.h"
@@ -29,6 +28,10 @@
#include "SkSLCompiler.h"
#endif
+#if defined(SK_ENABLE_SKOTTIE)
+#include "Skottie.h"
+#endif
+
#include <iostream>
#include <map>
#include <regex>
@@ -76,7 +79,6 @@
static void fuzz_path_deserialize(sk_sp<SkData>);
static void fuzz_region_deserialize(sk_sp<SkData>);
static void fuzz_region_set_path(sk_sp<SkData>);
-static void fuzz_skottie_json(sk_sp<SkData>);
static void fuzz_skp(sk_sp<SkData>);
static void fuzz_skpipe(sk_sp<SkData>);
static void fuzz_textblob_deserialize(sk_sp<SkData>);
@@ -87,6 +89,10 @@
static void fuzz_sksl2glsl(sk_sp<SkData>);
#endif
+#if defined(SK_ENABLE_SKOTTIE)
+static void fuzz_skottie_json(sk_sp<SkData>);
+#endif
+
int main(int argc, char** argv) {
SkCommandLineFlags::SetUsage("Usage: fuzz -t <type> -b <path/to/file> [-n api-to-fuzz]\n"
" fuzz -b <path/to/file>\n"
@@ -181,10 +187,12 @@
fuzz_skpipe(bytes);
return 0;
}
+#if defined(SK_ENABLE_SKOTTIE)
if (type.equals("skottie_json")) {
fuzz_skottie_json(bytes);
return 0;
}
+#endif
if (type.equals("skp")) {
fuzz_skp(bytes);
return 0;
@@ -264,12 +272,14 @@
return SkString("");
}
+#if defined(SK_ENABLE_SKOTTIE)
void FuzzSkottieJSON(sk_sp<SkData> bytes);
static void fuzz_skottie_json(sk_sp<SkData> bytes){
FuzzSkottieJSON(bytes);
SkDebugf("[terminated] Done animating!\n");
}
+#endif
// This adds up the first 1024 bytes and returns it as an 8 bit integer. This allows afl-fuzz to
// deterministically excercise different paths, or *options* (such as different scaling sizes or