[libpng16] Add some commonly-used transforms to the libpng fuzzer

This commit is contained in:
Glenn Randers-Pehrson
2017-10-10 20:30:54 -05:00
parent f5f8b98dbb
commit ab791fc9d6
2 changed files with 6 additions and 190 deletions

View File

@@ -163,6 +163,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return 0;
}
// Set several transforms that browsers typically use:
png_set_gray_to_rgb(png_handler.png_ptr);
png_set_expand(png_handler.png_ptr);
png_set_scale_16(png_handler.png_ptr);
png_set_add_alpha(png_handler.png_ptr, 0xffff, PNG_FILLER_AFTER);
int passes = png_set_interlace_handling(png_handler.png_ptr);
png_start_read_image(png_handler.png_ptr);