From 3226bd66d25396b51a0408c428964fc3301bd16e Mon Sep 17 00:00:00 2001 From: Tyson Smith Date: Thu, 22 Oct 2020 16:44:15 -0700 Subject: [PATCH] [mp4parse-rust] Build better avif corpus (#4558) --- projects/mp4parse-rust/Dockerfile | 2 +- projects/mp4parse-rust/build.sh | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/projects/mp4parse-rust/Dockerfile b/projects/mp4parse-rust/Dockerfile index 3732a3733..990fbbafa 100644 --- a/projects/mp4parse-rust/Dockerfile +++ b/projects/mp4parse-rust/Dockerfile @@ -17,7 +17,7 @@ FROM gcr.io/oss-fuzz-base/base-builder RUN apt-get update && apt-get install -y make autoconf automake libtool curl cmake python llvm-dev libclang-dev clang -RUN git clone --depth 1 https://github.com/mozilla/mp4parse-rust mp4parse-rust +RUN git clone --depth 1 --recursive https://github.com/mozilla/mp4parse-rust mp4parse-rust WORKDIR mp4parse-rust COPY build.sh default.options $SRC/ diff --git a/projects/mp4parse-rust/build.sh b/projects/mp4parse-rust/build.sh index d07f29a4a..8998c930a 100755 --- a/projects/mp4parse-rust/build.sh +++ b/projects/mp4parse-rust/build.sh @@ -19,9 +19,14 @@ PROJECT_DIR=$SRC/mp4parse-rust cd $PROJECT_DIR/mp4parse_capi/fuzz && cargo fuzz build -O --debug-assertions -mkdir $PROJECT_DIR/corpus -cp $PROJECT_DIR/mp4parse/tests/*.mp4 $PROJECT_DIR/corpus -cp $PROJECT_DIR/mp4parse_capi/tests/*.mp4 $PROJECT_DIR/corpus +# collect avif files +mkdir $PROJECT_DIR/avif_corpus +find $PROJECT_DIR/mp4parse -type f -name '*.avif' -exec cp '{}' $PROJECT_DIR/avif_corpus \; + +# collect mp4 files +mkdir $PROJECT_DIR/mp4_corpus +find $PROJECT_DIR/mp4parse/tests -type f -name '*.mp4' -exec cp '{}' $PROJECT_DIR/mp4_corpus \; +find $PROJECT_DIR/mp4parse_capi/tests/ -type f -name '*.mp4' -exec cp '{}' $PROJECT_DIR/mp4_corpus \; FUZZ_TARGET_OUTPUT_DIR=$PROJECT_DIR/mp4parse_capi/fuzz/target/x86_64-unknown-linux-gnu/release for f in $SRC/mp4parse-rust/mp4parse_capi/fuzz/fuzz_targets/*.rs @@ -30,5 +35,5 @@ do cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/ cp $PROJECT_DIR/mp4parse_capi/fuzz/mp4.dict $OUT/$FUZZ_TARGET_NAME.dict cp $SRC/default.options $OUT/$FUZZ_TARGET_NAME.options - zip -jr $OUT/${FUZZ_TARGET_NAME}_seed_corpus.zip $PROJECT_DIR/corpus/ + zip -jr $OUT/${FUZZ_TARGET_NAME}_seed_corpus.zip $PROJECT_DIR/${FUZZ_TARGET_NAME}_corpus/ done