• Home
Name Date Size #Lines LOC

..--

Android.bpD03-May-2024660 2725

README.mdD03-May-20241.5 KiB7160

ossfuzz.shD03-May-20241.3 KiB4421

xaac_dec_fuzzer.cppD03-May-202430.9 KiB875585

xaac_dec_fuzzer.dictD03-May-202440 32

README.md

1# Fuzzer for libxaac decoder
2
3This describes steps to build xaac_dec_fuzzer binary.
4
5## Linux x86/x64
6
7###  Requirements
8- cmake (3.5 or above)
9- make
10- clang (6.0 or above)
11  needs to support -fsanitize=fuzzer, -fsanitize=fuzzer-no-link
12
13### Steps to build
14Clone libxaac repository
15```
16$ git clone https://android.googlesource.com/platform/external/libxaac
17```
18Create a directory inside libxaac and change directory
19```
20 $ cd libxaac
21 $ mkdir build
22 $ cd build
23```
24Build libxaac using cmake
25```
26 $ CC=clang CXX=clang++ cmake ../ \
27   -DSANITIZE=fuzzer-no-link,address,signed-integer-overflow
28 $ make
29 ```
30Build the fuzzer
31```
32 $ clang++ -std=c++11 -fsanitize=fuzzer,address -I.  -I../  -I../common \
33   -I../decoder -I../decoder/drc_src -Wl,--start-group \
34   ../fuzzer/xaac_dec_fuzzer.cpp -o ./xaac_dec_fuzzer ./libxaacdec.a \
35   -Wl,--end-group
36```
37
38### Steps to run
39Create a directory CORPUS_DIR and copy some elementary aac files to that folder
40To run the fuzzer
41```
42$ ./xaac_dec_fuzzer CORPUS_DIR
43```
44
45## Android
46
47### Steps to build
48Build the fuzzer
49```
50  $ SANITIZE_TARGET=address SANITIZE_HOST=address mmma -j$(nproc) \
51    external/libxaac/fuzzer
52```
53
54### Steps to run
55Create a directory CORPUS_DIR and copy some elementary aac files to that folder
56Push this directory to device.
57
58To run on device
59```
60  $ adb sync data
61  $ adb shell /data/fuzz/xaac_dec_fuzzer CORPUS_DIR
62```
63To run on host
64```
65  $ $ANDROID_HOST_OUT/fuzz/xaac_dec_fuzzer CORPUS_DIR
66```
67
68## References:
69 * http://llvm.org/docs/LibFuzzer.html
70 * https://github.com/google/oss-fuzz
71