summaryrefslogtreecommitdiffstats
path: root/Makefile_util.am
diff options
context:
space:
mode:
authorOneric <oneric@oneric.stub>2021-08-26 23:02:31 +0200
committerOneric <oneric@oneric.stub>2022-07-03 16:19:06 +0200
commit9987eef44384b368670d962fca57b5994b216499 (patch)
tree07c6e526a03faa2d02b3d437fc79720b01a4e43c /Makefile_util.am
parentf1d19df9011ba5824bed137f4cc170d882514f33 (diff)
downloadlibass-9987eef44384b368670d962fca57b5994b216499.tar.bz2
libass-9987eef44384b368670d962fca57b5994b216499.tar.xz
Add fuzzing utility
Parses its input and renders every event at its start, middle and end. By default it is built as a simple standalone program, similar to profile to consume a single already existing input. By setting ASS_FUZZMODE in FUZZ_CPPFLAGS alternative buildmodes offering integration into AFL++ or LLVM's libFuzzer can be selected. As libFuzzer links in its own main function, it cannot be used during configure else the tests fail. Instead 'clang -fsanitize=fuzzer-no-link' can be set together with FUZZ_LDFLAGS='-fsanitize=fuzzer' to only link in the main function into the desired binary. As an alternative to FUZZ_LDFLAGS, it is also possible to change the compiler after configure via make CC=...
Diffstat (limited to 'Makefile_util.am')
-rw-r--r--Makefile_util.am8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile_util.am b/Makefile_util.am
index b150de06..be1cf880 100644
--- a/Makefile_util.am
+++ b/Makefile_util.am
@@ -21,3 +21,11 @@ compare_compare_SOURCES = compare/image.h compare/image.c compare/compare.c
compare_compare_CPPFLAGS = -I$(top_srcdir)/libass
compare_compare_LDADD = libass/libass.la
compare_compare_LDFLAGS = $(AM_LDFLAGS) $(LIBPNG_LIBS) -static
+
+if ENABLE_FUZZ
+noinst_PROGRAMS += fuzz/fuzz
+endif
+fuzz_fuzz_SOURCES = fuzz/fuzz.c
+fuzz_fuzz_CPPFLAGS = -I$(top_srcdir)/libass $(FUZZ_CPPFLAGS)
+fuzz_fuzz_LDADD = libass/libass.la
+fuzz_fuzz_LDFLAGS = $(AM_LDFLAGS) $(FUZZ_LDFLAGS) -static