curl -LO http://lcamtuf.coredump.cx/afl.tgz
tar zxvf afl.tgz
rm afl.tgz
cd afl*
make afl-gcc
make afl-fuzz
mkdir in_dir
echo 'hello' >in_dir/hello
# there is a glitch with the libjpeg-turbo-1.3.1 configure file that makes it difficult to compile on Mac, so I tried regular libjpeg:
curl -LO http://www.ijg.org/files/jpegsrc.v8c.tar.gz
tar zxvf jpegsrc.v8c.tar.gz
cd jpeg-8c/
CC=../afl-gcc ./configure
make
# error: C compiler cannot create executables
# if the above command worked to build an instrumented djpeg, then this should work
cd ..
./afl-fuzz -i in_dir -o out_dir ./jpeg-8c/djpeg