diff --git a/projects/libspng/Dockerfile b/projects/libspng/Dockerfile new file mode 100644 index 000000000..55c4c2edb --- /dev/null +++ b/projects/libspng/Dockerfile @@ -0,0 +1,28 @@ +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder + +MAINTAINER randy408@protonmail.com + +RUN apt-get update && \ + apt-get install -y -t xenial-backports meson ninja-build && \ + apt-get install -y pkg-config zlib1g-dev + +RUN git clone --depth 1 https://gitlab.com/randy408/libspng.git + +WORKDIR libspng +COPY build.sh $SRC/ diff --git a/projects/libspng/build.sh b/projects/libspng/build.sh new file mode 100644 index 000000000..62223bbd0 --- /dev/null +++ b/projects/libspng/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash -eu +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +mkdir build +meson --buildtype=plain --default-library static build +ninja -C build + +$CXX $CXXFLAGS -std=c++11 -I. \ + $SRC/libspng/tests/spng_read_fuzzer.cc \ + -o $OUT/spng_read_fuzzer \ + -lFuzzingEngine $SRC/libspng/build/libspng.a -lz + +find $SRC/libspng/tests/images -name "*.png" | \ + xargs zip $OUT/spng_read_fuzzer_seed_corpus.zip + +cp $SRC/libspng/tests/spng.dict \ + $SRC/libspng/tests/spng_read_fuzzer.options $OUT/ diff --git a/projects/libspng/project.yaml b/projects/libspng/project.yaml new file mode 100644 index 000000000..69e204daa --- /dev/null +++ b/projects/libspng/project.yaml @@ -0,0 +1,7 @@ +homepage: "https://libspng.org" +primary_contact: "randy408@protonmail.com" +auto_ccs: + - "randy440088@gmail.com" +sanitizers: + - address + - undefined