Skip to content
Myr

Merge branch 'fuzz' of https://github.com/randy408/stb into work2

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parents 3f5db89, 0637408 · Browse files · 10 files+29 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

10 files+29 added−0 removed

  • tests:+29 added−0 removed

10 files+29 added−0 removed

added:tests/pngsuite/iphone/iphone_basi0g01.pngbinary

A binary file, added.

added:tests/pngsuite/iphone/iphone_basi0g02.pngbinary

A binary file, added.

added:tests/pngsuite/iphone/iphone_basi3p02.pngbinary

A binary file, added.

added:tests/pngsuite/iphone/iphone_bgwn6a08.pngbinary

A binary file, added.

added:tests/pngsuite/iphone/iphone_bgyn6a16.pngbinary

A binary file, added.

added:tests/pngsuite/iphone/iphone_tbyn3p08.pngbinary

A binary file, added.

added:tests/pngsuite/iphone/iphone_z06n2c08.pngbinary

A binary file, added.

added:tests/stb_png_read_fuzzer.cpp+19 added
1#define STB_IMAGE_IMPLEMENTATION2#define STBI_ONLY_PNG3#include "../stb_image.h"45extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)6{7 int x, y, channels;89 if(!stbi_info_from_memory(data, size, &x, &y, &channels)) return 0;1011 /* exit if the image is larger than ~80MB */12 if(y && x > (80000000 / 4) / y) return 0;1314 unsigned char *img = stbi_load_from_memory(data, size, &x, &y, &channels, 4);1516 free(img);1718 return 0;19}
added:tests/stb_png_read_fuzzer.options+2 added
1[libfuzzer]2dict = stb_png.dict
added:tests/stb_png.dict+8 added
1header_png="\x89PNG\x0d\x0a\x1a\x0a"23section_idat="IDAT"4section_iend="IEND"5section_ihdr="IHDR"6section_plte="PLTE"7section_trns="tRNS"8section_cgbi="CgBI"