aboutsummaryrefslogtreecommitdiff
path: root/projects/poppler
diff options
context:
space:
mode:
authortsdgeos <aacid@kde.org>2020-03-21 05:12:04 +0100
committerGitHub <noreply@github.com>2020-03-20 21:12:04 -0700
commitcb09eba1ea4720f08110c9b5f988b80000670da9 (patch)
treed1ca87edafc788d35617088848d01dd06da053ab /projects/poppler
parentc623ca54ea9f0d545eb461c96e7472c6545f4296 (diff)
downloadoss-fuzz-cb09eba1ea4720f08110c9b5f988b80000670da9.tar.gz
[poppler] Compile and use openjpeg2 (#3532)
There's code in poppler side for handling openjpeg2 so it's good that that code gets fuzzed too
Diffstat (limited to 'projects/poppler')
-rw-r--r--projects/poppler/Dockerfile1
-rwxr-xr-xprojects/poppler/build.sh19
2 files changed, 15 insertions, 5 deletions
diff --git a/projects/poppler/Dockerfile b/projects/poppler/Dockerfile
index 672a9472a..6ae7c2ca1 100644
--- a/projects/poppler/Dockerfile
+++ b/projects/poppler/Dockerfile
@@ -20,6 +20,7 @@ RUN apt-get update && apt-get install -y make autoconf automake libtool pkg-conf
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/uclouvain/openjpeg
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
diff --git a/projects/poppler/build.sh b/projects/poppler/build.sh
index d6c335520..a2ac4a5ff 100755
--- a/projects/poppler/build.sh
+++ b/projects/poppler/build.sh
@@ -26,14 +26,18 @@ pushd $SRC/Little-CMS
make -j$(nproc)
make install
-mkdir -p $WORK/poppler
-pushd $WORK/poppler
-cmake $SRC/poppler \
+mkdir -p $SRC/openjpeg/build
+pushd $SRC/openjpeg/build
+cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$WORK
+make -j$(nproc) install
+
+mkdir -p $SRC/poppler/build
+pushd $SRC/poppler/build
+cmake .. \
-DCMAKE_BUILD_TYPE=debug \
-DBUILD_SHARED_LIBS=OFF \
-DFONT_CONFIGURATION=generic \
-DENABLE_DCTDECODER=none \
- -DENABLE_LIBOPENJPEG=none \
-DENABLE_LIBPNG=OFF \
-DENABLE_ZLIB=OFF \
-DENABLE_LIBTIFF=OFF \
@@ -51,7 +55,12 @@ 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 $WORK/lib/libfreetype.a $WORK/lib/liblcms2.a
+ $LIB_FUZZING_ENGINE \
+ $SRC/poppler/build/cpp/libpoppler-cpp.a \
+ $SRC/poppler/build/libpoppler.a \
+ $WORK/lib/libfreetype.a \
+ $WORK/lib/liblcms2.a \
+ $WORK/lib/libopenjp2.a
mv $SRC/{*.zip,*.dict} $OUT