[kimageformats] Include ora and kra handlers (#2277)

This pulls karchive that pulls, ecm and libzip and libzip pulls zlib
This commit is contained in:
tsdgeos 2019-03-31 20:04:40 +02:00 committed by Max Moroz
parent 080a64aca0
commit 5f2ed9d550
3 changed files with 30 additions and 1 deletions

View File

@ -16,7 +16,12 @@
FROM gcr.io/oss-fuzz-base/base-builder
MAINTAINER tsdgeos@gmail.com
RUN apt-get install --yes cmake
RUN git clone --depth 1 https://github.com/madler/zlib.git
RUN git clone --depth 1 https://github.com/nih-at/libzip.git
RUN git clone --depth 1 git://anongit.kde.org/extra-cmake-modules
RUN git clone --depth 1 git://code.qt.io/qt/qtbase.git
RUN git clone --depth 1 git://anongit.kde.org/karchive
RUN git clone --depth 1 git://anongit.kde.org/kimageformats
COPY build.sh $SRC
COPY kimgio_fuzzer.cc $SRC

View File

@ -1,3 +1,18 @@
cd $SRC
cd zlib
./configure --static
make install -j$(nproc)
cd $SRC
cd libzip
cmake . -DBUILD_SHARED_LIBS=OFF
make install -j$(nproc)
cd $SRC
cd extra-cmake-modules
cmake .
make install -j$(nproc)
cd $SRC
cd qtbase
# add the flags to Qt build too, we may as well sanitize Qt too (and also fixes memory sanitizer build)
@ -12,6 +27,11 @@ cd src
../bin/qmake -o Makefile src.pro
make sub-gui -j$(nproc)
$CXX $CXXFLAGS -fPIC -std=c++11 $SRC/kimgio_fuzzer.cc $SRC/kimageformats/src/imageformats/pcx.cpp $SRC/kimageformats/src/imageformats/pic.cpp $SRC/kimageformats/src/imageformats/psd.cpp $SRC/kimageformats/src/imageformats/ras.cpp $SRC/kimageformats/src/imageformats/rgb.cpp $SRC/kimageformats/src/imageformats/tga.cpp $SRC/kimageformats/src/imageformats/xcf.cpp -o $OUT/kimgio_fuzzer -I $SRC/qtbase/include/QtCore/ -I $SRC/qtbase/include/ -I $SRC/qtbase/include//QtGui -I $SRC/kimageformats/src/imageformats/ -L $SRC/qtbase/lib -lQt5Gui -lQt5Core -lqtlibpng -lqtharfbuzz -lm -lqtpcre2 -ldl -lpthread -lFuzzingEngine
cd $SRC
cd karchive
cmake . -DBUILD_SHARED_LIBS=OFF -DQt5Core_DIR=$SRC/qtbase/lib/cmake/Qt5Core/ -DBUILD_TESTING=OFF
make install -j$(nproc)
$CXX $CXXFLAGS -fPIC -std=c++11 $SRC/kimgio_fuzzer.cc $SRC/kimageformats/src/imageformats/kra.cpp $SRC/kimageformats/src/imageformats/ora.cpp $SRC/kimageformats/src/imageformats/pcx.cpp $SRC/kimageformats/src/imageformats/pic.cpp $SRC/kimageformats/src/imageformats/psd.cpp $SRC/kimageformats/src/imageformats/ras.cpp $SRC/kimageformats/src/imageformats/rgb.cpp $SRC/kimageformats/src/imageformats/tga.cpp $SRC/kimageformats/src/imageformats/xcf.cpp -o $OUT/kimgio_fuzzer -I $SRC/qtbase/include/QtCore/ -I $SRC/qtbase/include/ -I $SRC/qtbase/include//QtGui -I $SRC/kimageformats/src/imageformats/ -I $SRC/karchive/src/ -I $SRC/qtbase/mkspecs/linux-clang-libc++/ -L $SRC/qtbase/lib -lQt5Gui -lQt5Core -lqtlibpng -lqtharfbuzz -lm -lqtpcre2 -ldl -lpthread -lFuzzingEngine /usr/local/lib/libzip.a /usr/local/lib/libz.a -lKF5Archive
zip -qr $OUT/kimgio_fuzzer_seed_corpus.zip $SRC/kimageformats/autotests/read/ $SRC/kimageformats/autotests/write/ $SRC/kimageformats/autotests/pic/

View File

@ -28,6 +28,8 @@
#include <QCoreApplication>
#include <QImage>
#include "kra.h"
#include "ora.h"
#include "pcx_p.h"
#include "pic_p.h"
#include "psd_p.h"
@ -42,6 +44,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
QCoreApplication a(argc, nullptr);
const QVector<QImageIOHandler*> handlers = {
new KraHandler(),
new OraHandler(),
new PCXHandler(),
new SoftimagePICHandler(),
new PSDHandler(),