mirror of https://github.com/google/oss-fuzz.git
kimageformats: build libjxl and JXL Qt plug-in (#6854)
This commit is contained in:
parent
38f3b3928f
commit
6a16b2856d
|
@ -26,6 +26,7 @@ RUN git clone --depth 1 -b v3.2.0 https://aomedia.googlesource.com/aom
|
|||
RUN git clone --depth 1 -b v0.9.3 https://github.com/AOMediaCodec/libavif.git
|
||||
RUN git clone --depth 1 https://github.com/strukturag/libde265.git
|
||||
RUN git clone --depth 1 https://github.com/strukturag/libheif.git
|
||||
RUN git clone --depth=1 --branch v0.6.x --recursive https://github.com/libjxl/libjxl.git
|
||||
COPY build.sh $SRC
|
||||
COPY kimgio_fuzzer.cc $SRC
|
||||
WORKDIR kimageformats
|
||||
|
|
|
@ -83,11 +83,19 @@ cmake -DBUILD_SHARED_LIBS=OFF -DWITH_AOM=ON -DWITH_DAV1D=OFF -DWITH_EXAMPLES=OFF
|
|||
make -j$(nproc)
|
||||
make install -j$(nproc)
|
||||
|
||||
cd $SRC
|
||||
cd libjxl
|
||||
mkdir build
|
||||
cd build
|
||||
CXXFLAGS="$CXXFLAGS -DHWY_COMPILE_ONLY_SCALAR" cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DJPEGXL_BUNDLE_SKCMS=ON -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_ENABLE_EXAMPLES=OFF -DJPEGXL_ENABLE_JNI=OFF -DJPEGXL_ENABLE_MANPAGES=OFF -DJPEGXL_ENABLE_OPENEXR=OFF -DJPEGXL_ENABLE_PLUGINS=OFF -DJPEGXL_ENABLE_SJPEG=OFF -DJPEGXL_ENABLE_SKCMS=ON -DJPEGXL_ENABLE_TCMALLOC=OFF -DJPEGXL_ENABLE_TOOLS=OFF ..
|
||||
make -j$(nproc) jxl-static jxl_threads-static
|
||||
|
||||
cd $SRC
|
||||
cd kimageformats
|
||||
HANDLER_TYPES="ANIHandler ani
|
||||
QAVIFHandler avif
|
||||
HEIFHandler heif
|
||||
QJpegXLHandler jxl
|
||||
KraHandler kra
|
||||
OraHandler ora
|
||||
PCXHandler pcx
|
||||
|
@ -103,7 +111,7 @@ echo "$HANDLER_TYPES" | while read class format; do
|
|||
fuzz_target_name=kimgio_${format}_fuzzer
|
||||
|
||||
$SRC/qtbase/bin/moc $SRC/kimageformats/src/imageformats/$format.cpp -o $format.moc
|
||||
$CXX $CXXFLAGS -fPIC -DHANDLER=$class -std=c++17 $SRC/kimgio_fuzzer.cc $SRC/kimageformats/src/imageformats/$format.cpp -o $OUT/$fuzz_target_name -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++/ -I $SRC/libavif/include/ -I . -L $SRC/qtbase/lib $SRC/libavif/build/libavif.a /usr/local/lib/libheif.a /usr/local/lib/liblibde265.a $SRC/aom/build.libavif/libaom.a -lQt5Gui -lQt5Core -lqtlibpng -lqtharfbuzz -lm -lqtpcre2 -ldl -lpthread $LIB_FUZZING_ENGINE /usr/local/lib/libzip.a /usr/local/lib/libz.a -lKF5Archive /usr/local/lib/libz.a
|
||||
$CXX $CXXFLAGS -fPIC -DHANDLER=$class -std=c++17 $SRC/kimgio_fuzzer.cc $SRC/kimageformats/src/imageformats/$format.cpp -o $OUT/$fuzz_target_name -DJXL_STATIC_DEFINE -DJXL_THREADS_STATIC_DEFINE -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++/ -I $SRC/libavif/include/ -I $SRC/libjxl/build/lib/include/ -I $SRC/libjxl/lib/include/ -I . -L $SRC/qtbase/lib $SRC/libavif/build/libavif.a /usr/local/lib/libheif.a /usr/local/lib/liblibde265.a $SRC/aom/build.libavif/libaom.a $SRC/libjxl/build/lib/libjxl_threads.a $SRC/libjxl/build/lib/libjxl.a $SRC/libjxl/build/third_party/highway/libhwy.a $SRC/libjxl/build/third_party/brotli/libbrotlidec-static.a $SRC/libjxl/build/third_party/brotli/libbrotlienc-static.a $SRC/libjxl/build/third_party/brotli/libbrotlicommon-static.a -lQt5Gui -lQt5Core -lqtlibpng -lqtharfbuzz -lm -lqtpcre2 -ldl -lpthread $LIB_FUZZING_ENGINE /usr/local/lib/libzip.a /usr/local/lib/libz.a -lKF5Archive /usr/local/lib/libz.a
|
||||
|
||||
find . -name "*.${format}" | zip -q $OUT/${fuzz_target_name}_seed_corpus.zip -@
|
||||
)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
Usage:
|
||||
python infra/helper.py build_image kimageformats
|
||||
python infra/helper.py build_fuzzers --sanitizer undefined|address|memory kimageformats
|
||||
python infra/helper.py run_fuzzer kimageformats kimgio_[ani|avif|heif|kra|ora|pcx|pic|psd|ras|rgb|tga|xcf]_fuzzer
|
||||
python infra/helper.py run_fuzzer kimageformats kimgio_[ani|avif|heif|jxl|kra|ora|pcx|pic|psd|ras|rgb|tga|xcf]_fuzzer
|
||||
*/
|
||||
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
|||
#include "ani_p.h"
|
||||
#include "avif_p.h"
|
||||
#include "heif_p.h"
|
||||
#include "jxl_p.h"
|
||||
#include "kra.h"
|
||||
#include "ora.h"
|
||||
#include "pcx_p.h"
|
||||
|
|
Loading…
Reference in New Issue