The fuzzer plugin for G711 is designed based on the understanding of the codec and tries to achieve the following:
G711 supports two types of decoding:
These two decoder API's are fuzzed separately using g711alaw_dec_fuzzer and g711mlaw_dec_fuzzer respectively.
The plugin feeds the entire input data to the codec as expected by decoder API.
This describes steps to build g711alaw_dec_fuzzer and g711mlaw_dec_fuzzer binary.
Build the fuzzer
$ mm -j$(nproc) g711alaw_dec_fuzzer $ mm -j$(nproc) g711mlaw_dec_fuzzer
Create a directory CORPUS_DIR and copy some g711 files to that folder Push this directory to device.
To run on device
$ adb sync data $ adb shell /data/fuzz/arm64/g711alaw_dec_fuzzer/g711alaw_dec_fuzzer CORPUS_DIR $ adb shell /data/fuzz/arm64/g711mlaw_dec_fuzzer/g711mlaw_dec_fuzzer CORPUS_DIR
To run on host
$ $ANDROID_HOST_OUT/fuzz/x86_64/g711alaw_dec_fuzzer/g711alaw_dec_fuzzer CORPUS_DIR $ $ANDROID_HOST_OUT/fuzz/x86_64/g711mlaw_dec_fuzzer/g711mlaw_dec_fuzzer CORPUS_DIR