Build lcms2 for poppler (#3528)

There's quite some code hidden behind
  #ifdef USE_CMS
so better to fuzz that code too
This commit is contained in:
tsdgeos 2020-03-20 16:45:47 +01:00 committed by GitHub
parent 3c28d2a860
commit 77ef89c1da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -19,6 +19,7 @@ MAINTAINER jonathan@titanous.com
RUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config cmake
RUN git clone --depth 1 https://anongit.freedesktop.org/git/poppler/poppler.git
RUN git clone --depth 1 git://git.sv.nongnu.org/freetype/freetype2.git
RUN git clone --depth 1 https://github.com/mm2/Little-CMS.git
RUN git clone --depth 1 https://github.com/mozilla/pdf.js pdf.js && \
zip -q $SRC/pdf_fuzzer_seed_corpus.zip pdf.js/test/pdfs/*.pdf && \
rm -rf pdf.js

View File

@ -21,6 +21,11 @@ pushd $SRC/freetype2
make -j$(nproc)
make install
pushd $SRC/Little-CMS
./configure --prefix="$WORK" --disable-shared PKG_CONFIG_PATH="$WORK/lib/pkgconfig"
make -j$(nproc)
make install
mkdir -p $WORK/poppler
pushd $WORK/poppler
cmake $SRC/poppler \
@ -29,7 +34,6 @@ cmake $SRC/poppler \
-DFONT_CONFIGURATION=generic \
-DENABLE_DCTDECODER=none \
-DENABLE_LIBOPENJPEG=none \
-DENABLE_CMS=none \
-DENABLE_LIBPNG=OFF \
-DENABLE_ZLIB=OFF \
-DENABLE_LIBTIFF=OFF \
@ -40,15 +44,14 @@ cmake $SRC/poppler \
-DENABLE_UTILS=OFF \
-DWITH_Cairo=OFF \
-DWITH_NSS3=OFF \
-DFREETYPE_INCLUDE_DIRS=$WORK/include/freetype2 \
-DFREETYPE_LIBRARY=$WORK/lib
-DCMAKE_INSTALL_PREFIX=$WORK
make -j$(nproc) poppler poppler-cpp
fuzz_target=pdf_fuzzer
$CXX $CXXFLAGS -std=c++11 -I$SRC/poppler/cpp \
$SRC/fuzz/pdf_fuzzer.cc -o $OUT/$fuzz_target \
$LIB_FUZZING_ENGINE $WORK/poppler/cpp/libpoppler-cpp.a $WORK/poppler/libpoppler.a $WORK/lib/libfreetype.a
$LIB_FUZZING_ENGINE $WORK/poppler/cpp/libpoppler-cpp.a $WORK/poppler/libpoppler.a $WORK/lib/libfreetype.a $WORK/lib/libfreetype.a $WORK/lib/liblcms2.a
mv $SRC/{*.zip,*.dict} $OUT