Skip to content

Commit

Permalink
image-rs: Add seed corpora (#11327)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathaniel-brough authored Dec 15, 2023
1 parent afccb18 commit 913146b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions projects/image-rs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,28 @@
#
################################################################################


# ---- Build fuzz corpuses ---- #
function zip_files() {
# Get the arguments
directory=$1
extension=$2
zipfile=$3

# Find all files with the given extension in the given directory and its subdirectories
# and add them to the zip file
find "$directory" -type f -name "*.$extension" -exec zip -r -j "$zipfile" {} +
}

FORMATS=("bmp" "exr" "gif" "hdr" "ico" "jpeg" "png" "pnm" "tga" "tiff" "webp")

for FORMAT in "${FORMATS[@]}"
do
zip_files . $FORMAT "$OUT/fuzzer_script_${FORMAT}_seed_corpus.zip"
done

# ---- Build fuzz harnesses ----

cargo fuzz build -O
cargo fuzz list | while read i; do
cp fuzz/target/x86_64-unknown-linux-gnu/release/$i $OUT/
Expand Down

0 comments on commit 913146b

Please sign in to comment.