mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Revert "oss-fuzz: Update the README file, the Docker file and the build script"
This reverts commit 3117b5f94a.
A regression was introduced. (Oopsie!)
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
# Copyright 2024 Cosmin Truta
|
|
||||||
# Copyright 2017 Glenn Randers-Pehrson
|
|
||||||
# Copyright 2016 Google Inc.
|
# Copyright 2016 Google Inc.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -17,12 +15,11 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
FROM gcr.io/oss-fuzz-base/base-builder
|
FROM gcr.io/oss-fuzz-base/base-builder
|
||||||
|
MAINTAINER glennrp@gmail.com
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y make autoconf automake libtool zlib1g-dev
|
apt-get install -y make autoconf automake libtool
|
||||||
|
|
||||||
RUN git clone --depth=1 https://github.com/pnggroup/libpng.git && \
|
RUN git clone --depth 1 https://github.com/madler/zlib.git
|
||||||
git clone --depth=1 https://github.com/madler/zlib.git && \
|
RUN git clone --depth 1 https://github.com/glennrp/libpng.git
|
||||||
cp libpng/contrib/oss-fuzz/build.sh $SRC
|
RUN cp libpng/contrib/oss-fuzz/build.sh $SRC
|
||||||
|
WORKDIR libpng
|
||||||
WORKDIR /home/libpng
|
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
libpng additions to oss-fuzz
|
|
||||||
============================
|
|
||||||
|
|
||||||
Copyright (c) 2024 Cosmin Truta
|
|
||||||
Copyright (c) 2017 Glenn Randers-Pehrson
|
Copyright (c) 2017 Glenn Randers-Pehrson
|
||||||
|
|
||||||
This code is released under the libpng license.
|
This code is released under the libpng license.
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/bash -eu
|
||||||
set -eu
|
|
||||||
|
|
||||||
# Copyright 2024 Cosmin Truta
|
# Copyright 2017-2018 Glenn Randers-Pehrson
|
||||||
# Copyright 2017 Glenn Randers-Pehrson
|
|
||||||
# Copyright 2016 Google Inc.
|
# Copyright 2016 Google Inc.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -17,31 +15,36 @@ set -eu
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# Revisions by Glenn Randers-Pehrson, 2017:
|
||||||
|
# 1. Build only the library, not the tools (changed "make -j$(nproc) all" to
|
||||||
|
# "make -j$(nproc) libpng16.la").
|
||||||
|
# 2. Disabled WARNING and WRITE options in pnglibconf.dfa.
|
||||||
|
# 3. Build zlib alongside libpng
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Disable logging via library build configuration control.
|
# Disable logging via library build configuration control.
|
||||||
sed -e "s/option STDIO/option STDIO disabled/" \
|
cat scripts/pnglibconf.dfa | \
|
||||||
-e "s/option WARNING /option WARNING disabled/" \
|
sed -e "s/option STDIO/option STDIO disabled/" \
|
||||||
-e "s/option WRITE enables WRITE_INT_FUNCTIONS/option WRITE disabled/" \
|
-e "s/option WARNING /option WARNING disabled/" \
|
||||||
scripts/pnglibconf.dfa >scripts/pnglibconf.dfa.tmp
|
-e "s/option WRITE enables WRITE_INT_FUNCTIONS/option WRITE disabled/" \
|
||||||
mv -f scripts/pnglibconf.dfa.tmp scripts/pnglibconf.dfa
|
> scripts/pnglibconf.dfa.temp
|
||||||
|
mv scripts/pnglibconf.dfa.temp scripts/pnglibconf.dfa
|
||||||
|
|
||||||
# Build the libpng library ("libpng16.la"), excluding the auxiliary tools.
|
# build the libpng library.
|
||||||
autoreconf -f -i
|
autoreconf -f -i
|
||||||
./configure --with-libpng-prefix=OSS_FUZZ_
|
./configure --with-libpng-prefix=OSS_FUZZ_
|
||||||
make -j$(nproc) clean
|
make -j$(nproc) clean
|
||||||
make -j$(nproc) libpng16.la
|
make -j$(nproc) libpng16.la
|
||||||
|
|
||||||
# Build libpng_read_fuzzer.
|
# build libpng_read_fuzzer.
|
||||||
$CXX $CXXFLAGS -std=c++11 -I. \
|
$CXX $CXXFLAGS -std=c++11 -I. \
|
||||||
$SRC/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc \
|
$SRC/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc \
|
||||||
-o $OUT/libpng_read_fuzzer \
|
-o $OUT/libpng_read_fuzzer \
|
||||||
-lFuzzingEngine .libs/libpng16.a -lz
|
-lFuzzingEngine .libs/libpng16.a -lz
|
||||||
|
|
||||||
# Add seed corpus.
|
# add seed corpus.
|
||||||
find $SRC/libpng -name "*.png" | grep -v crashers | \
|
find $SRC/libpng -name "*.png" | grep -v crashers | \
|
||||||
xargs zip $OUT/libpng_read_fuzzer_seed_corpus.zip
|
xargs zip $OUT/libpng_read_fuzzer_seed_corpus.zip
|
||||||
|
|
||||||
cp $SRC/libpng/contrib/oss-fuzz/*.dict \
|
cp $SRC/libpng/contrib/oss-fuzz/*.dict \
|
||||||
$SRC/libpng/contrib/oss-fuzz/*.options \
|
$SRC/libpng/contrib/oss-fuzz/*.options $OUT/
|
||||||
$OUT/
|
|
||||||
|
|||||||
Reference in New Issue
Block a user