Makefile.in                 |    2 -
 Repository.mk               |    1 
 vcl/Executable_giffuzzer.mk |   47 ++++++++++++++++++++++++++++++++++++++++++++
 vcl/Module_vcl.mk           |    1 
 vcl/workben/giffuzzer.cxx   |   22 ++++++++++++++++++++
 5 files changed, 72 insertions(+), 1 deletion(-)

New commits:
commit 6bd7451ecd66417a4e8b8dff3874c15ba4d1536e
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Jan 3 18:41:22 2017 +0000

    add gif fuzzer
    
    Change-Id: I47dc449464cc7643d05b73e9612d01e50a8d4b8e

diff --git a/Makefile.in b/Makefile.in
index 43fd5e9..a3b2a9f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -424,7 +424,7 @@ $(foreach ide,\
     eclipsecdt,\
 $(eval $(call gb_Top_GbuildToIdeIntegration,$(ide))))
 
-fuzzers: Library_sal Library_salhelper Library_reg Library_store 
Library_unoidl codemaker Library_cppu Library_i18nlangtag Library_cppuhelper 
Library_comphelper StaticLibrary_ulingu StaticLibrary_jpeg 
StaticLibrary_findsofficepath Library_tl Rdb_services udkapi offapi 
Library_clew Library_gie Library_reflection Library_invocadapt 
Library_bootstrap Library_introspection Library_stocservices Library_xmlreader 
Library_gcc3_uno instsetoo_native more_fonts StaticLibrary_fuzzer 
Executable_wmffuzzer Executable_jpgfuzzer
+fuzzers: Library_sal Library_salhelper Library_reg Library_store 
Library_unoidl codemaker Library_cppu Library_i18nlangtag Library_cppuhelper 
Library_comphelper StaticLibrary_ulingu StaticLibrary_jpeg 
StaticLibrary_findsofficepath Library_tl Rdb_services udkapi offapi 
Library_clew Library_gie Library_reflection Library_invocadapt 
Library_bootstrap Library_introspection Library_stocservices Library_xmlreader 
Library_gcc3_uno instsetoo_native more_fonts StaticLibrary_fuzzer 
Executable_wmffuzzer Executable_jpgfuzzer Executable_giffuzzer
 
 endif # MAKE_RESTARTS
 
diff --git a/Repository.mk b/Repository.mk
index 8305c97..5d68ba00 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -95,6 +95,7 @@ $(eval $(call 
gb_Helper_register_executables_for_install,OOO,brand, \
        $(call gb_Helper_optional,BREAKPAD,minidump_upload) \
        $(call gb_Helper_optional,FUZZERS,wmffuzzer) \
        $(call gb_Helper_optional,FUZZERS,jpgfuzzer) \
+       $(call gb_Helper_optional,FUZZERS,giffuzzer) \
        $(if $(filter-out ANDROID IOS MACOSX WNT,$(OS)),oosplash) \
        soffice_bin \
        $(if $(filter DESKTOP,$(BUILD_TYPE)),unopkg_bin) \
diff --git a/vcl/Executable_giffuzzer.mk b/vcl/Executable_giffuzzer.mk
new file mode 100644
index 0000000..132b445
--- /dev/null
+++ b/vcl/Executable_giffuzzer.mk
@@ -0,0 +1,47 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+include $(SRCDIR)/vcl/commonfuzzer.mk
+
+$(eval $(call gb_Executable_Executable,giffuzzer))
+
+$(eval $(call gb_Executable_use_api,giffuzzer,\
+    offapi \
+    udkapi \
+))
+
+$(eval $(call gb_Executable_use_externals,giffuzzer,\
+       $(fuzzer_externals) \
+))
+
+$(eval $(call gb_Executable_set_include,giffuzzer,\
+    $$(INCLUDE) \
+    -I$(SRCDIR)/vcl/inc \
+))
+
+$(eval $(call gb_Executable_use_libraries,giffuzzer,\
+       $(fuzzer_libraries) \
+))
+
+$(eval $(call gb_Executable_use_static_libraries,giffuzzer,\
+    findsofficepath \
+    ulingu \
+    fuzzer \
+))
+
+$(eval $(call gb_Executable_add_exception_objects,giffuzzer,\
+       vcl/workben/giffuzzer \
+))
+
+$(eval $(call gb_Executable_add_libs,giffuzzer,\
+       -lFuzzingEngine \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index a9b91eb..44b5131 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -108,6 +108,7 @@ $(eval $(call gb_Module_add_targets,vcl,\
     StaticLibrary_fuzzer \
     Executable_wmffuzzer \
     Executable_jpgfuzzer \
+    Executable_giffuzzer \
 ))
 endif
 
diff --git a/vcl/workben/giffuzzer.cxx b/vcl/workben/giffuzzer.cxx
new file mode 100644
index 0000000..20167da
--- /dev/null
+++ b/vcl/workben/giffuzzer.cxx
@@ -0,0 +1,22 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <tools/stream.hxx>
+#include <../source/filter/igif/gifread.hxx>
+#include "commonfuzzer.hxx"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
+{
+    SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
+    Graphic aGraphic;
+    (void)ImportGIF(aStream, aGraphic);
+    return 0;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to