Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libvips] Add aom/libheif as dependencies to enable AVIF fuzzing #4463

Merged
merged 1 commit into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions projects/libvips/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
38 changes: 38 additions & 0 deletions projects/libvips/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
################################################################################

export PKG_CONFIG_PATH=/work/lib/pkgconfig
export LDFLAGS="$CXXFLAGS"

# libz
pushd $SRC/zlib
Expand All @@ -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
Expand Down Expand Up @@ -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 \
Expand Down