Libpng is not exactly a plug-and-play target, but it shouldn't be too
hard. First of all, you want to apply
afl/experimental/libpng_no_checksum/libpng-nocrc.patch to libpng to
remove CRC checks.
Then, you want to compile the library with:
CC=/path/to/afl-gcc ./configure --disable-shared && make -j4
When this is done, you need a target binary that reads from stdin and
does something interesting with the image data. There's one decent
target that comes with libpng, although it's not built by default. Go
to contrib/libtests in the libpng directory, and try:
/path/to/afl-gcc ./readpng.c -lm -lz ../../.libs/libpng16.a -o readpng
The resulting binary, readpng, should be a suitable target. You want
to fuzz it like so:
./afl-fuzz -i testcases/images/png -o some_output_dir -x
dictionaries/png.dict /path/to/readpng
That should do the trick and get you going. Note that to load any of
the generated test cases into a non-patched version of libpng, you'd
need to fix up CRC.
/mz