diff options
| author | Ray Essick <essick@google.com> | 2019-10-02 21:21:53 -0700 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2019-10-02 21:21:53 -0700 |
| commit | 185d891f1c282732584f5dbfed224ddefe864cc6 (patch) | |
| tree | e418d7b37688a36e17ea55bed225d1b4e837e2e1 /fuzzer | |
| parent | 008187186fdd566833d3b6d518c1009a9844857d (diff) | |
| parent | 6891249c9ca2237b08665380b169d78f96878a51 (diff) | |
| download | platform_external_libmpeg2-185d891f1c282732584f5dbfed224ddefe864cc6.tar.gz platform_external_libmpeg2-185d891f1c282732584f5dbfed224ddefe864cc6.tar.bz2 platform_external_libmpeg2-185d891f1c282732584f5dbfed224ddefe864cc6.zip | |
Merge "fuzzer: Create ossfuzz.sh to build with oss-fuzz"
am: 6891249c9c
Change-Id: I082c5ed96ba43119b840a3336c4ca0ed21ca604e
Diffstat (limited to 'fuzzer')
| -rwxr-xr-x | fuzzer/ossfuzz.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/fuzzer/ossfuzz.sh b/fuzzer/ossfuzz.sh new file mode 100755 index 0000000..3493031 --- /dev/null +++ b/fuzzer/ossfuzz.sh @@ -0,0 +1,44 @@ +#!/bin/bash -eu +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# Ensure SRC and WORK are set +test "${SRC}" != "" || exit 1 +test "${WORK}" != "" || exit 1 +test "${OUT}" != "" || exit 1 + +# Build libmpeg2 +build_dir=$WORK/build +rm -rf ${build_dir} +mkdir -p ${build_dir} +pushd ${build_dir} + +cmake $SRC/libmpeg2 +make -j$(nproc) +popd + +# build fuzzers +$CXX $CXXFLAGS -std=c++11 \ +-I$SRC/libmpeg2 \ +-I$SRC/libmpeg2/common \ +-I$SRC/libmpeg2/decoder \ +-I${build_dir} \ +-Wl,--start-group \ +$LIB_FUZZING_ENGINE \ +$SRC/libmpeg2/fuzzer/mpeg2_dec_fuzzer.cpp -o $OUT/mpeg2_dec_fuzzer \ +${build_dir}/libmpeg2dec.a \ +-Wl,--end-group + +cp $SRC/mpeg2_dec_fuzzer_seed_corpus.zip $OUT/mpeg2_dec_fuzzer_seed_corpus.zip +cp $SRC/libmpeg2/fuzzer/mpeg2_dec_fuzzer.dict $OUT/mpeg2_dec_fuzzer.dict |
