sharp: add seed corpus (#12256)

This commit is contained in:
Kleis Auke Wolthuizen 2024-07-20 18:55:39 +02:00 committed by GitHub
parent 5c99ed9f0e
commit dd3e38d3e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -16,6 +16,8 @@
FROM gcr.io/oss-fuzz-base/base-builder-javascript
RUN mkdir afl-testcases
RUN curl https://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz | tar xzC afl-testcases
RUN git clone --depth 1 https://github.com/lovell/sharp.git
COPY build.sh $SRC/

View File

@ -22,3 +22,12 @@ npm install --save-dev @jazzer.js/core
# Build Fuzzers.
compile_javascript_fuzzer sharp fuzz.js -i sharp
# Merge the seed corpus in a single directory, exclude files larger than 4k
mkdir -p fuzz/corpus
find \
$SRC/afl-testcases/{gif*,jpeg*,png,tiff,webp}/full/images \
test/fixtures \
-type f -size -4k \
-exec bash -c 'hash=($(sha1sum {})); mv {} fuzz/corpus/$hash' \;
zip -jrq $OUT/fuzz_seed_corpus.zip fuzz/corpus