libvips: add libheif and libaom as dependencies (#4463)

Allows fuzz testing of AVIF/HEIF inputs
This commit is contained in:
Lovell Fuller 2020-09-21 16:17:58 +01:00 committed by GitHub
parent 8412009d55
commit e25d79502e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 0 deletions

View File

@ -36,5 +36,8 @@ RUN git clone --depth 1 https://github.com/glennrp/libpng.git
RUN git clone --depth 1 https://git.code.sf.net/p/giflib/code libgif
RUN git clone --depth 1 https://chromium.googlesource.com/webm/libwebp
RUN git clone --depth 1 https://gitlab.com/libtiff/libtiff
RUN git clone --depth 1 https://aomedia.googlesource.com/aom
RUN git clone --depth 1 https://github.com/strukturag/libheif
WORKDIR libvips
COPY build.sh $SRC/

View File

@ -16,6 +16,7 @@
################################################################################
export PKG_CONFIG_PATH=/work/lib/pkgconfig
export LDFLAGS="$CXXFLAGS"
# libz
pushd $SRC/zlib
@ -36,6 +37,41 @@ make -j$(nproc)
make install
popd
# aom
pushd $SRC/aom
mkdir -p build/linux
cd build/linux
cmake -G "Unix Makefiles" \
-DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \
-DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_INSTALL_PREFIX=$WORK -DCMAKE_INSTALL_LIBDIR=lib \
-DENABLE_SHARED:bool=off -DCONFIG_PIC=1 \
-DENABLE_EXAMPLES=0 -DENABLE_DOCS=0 -DENABLE_TESTS=0 \
-DCONFIG_SIZE_LIMIT=1 \
-DDECODE_HEIGHT_LIMIT=12288 -DDECODE_WIDTH_LIMIT=12288 \
-DDO_RANGE_CHECK_CLAMP=1 \
-DAOM_MAX_ALLOCABLE_MEMORY=536870912 \
-DAOM_TARGET_CPU=generic \
../../
make clean
make -j$(nproc)
make install
popd
# libheif
pushd $SRC/libheif
autoreconf -fi
./configure \
--disable-shared \
--enable-static \
--disable-examples \
--disable-go \
--prefix=$WORK
make clean
make -j$(nproc)
make install
popd
# libjpeg-turbo
pushd $SRC/libjpeg-turbo
cmake . -DCMAKE_INSTALL_PREFIX=$WORK -DENABLE_STATIC:bool=on
@ -128,6 +164,8 @@ for fuzzer in fuzz/*_fuzzer.cc; do
$WORK/lib/libwebpdemux.a \
$WORK/lib/libwebp.a \
$WORK/lib/libtiff.a \
$WORK/lib/libheif.a \
$WORK/lib/libaom.a \
$LIB_FUZZING_ENGINE \
-Wl,-Bstatic \
-lfftw3 -lgmodule-2.0 -lgio-2.0 -lgobject-2.0 -lffi -lglib-2.0 -lpcre -lexpat \