Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lvandeve/lodepng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArshdeep Singh <singh.arshdeep1999@gmail.com>2020-06-12 20:52:43 +0300
committerArshdeep Singh <singh.arshdeep1999@gmail.com>2020-06-12 20:52:43 +0300
commit373c2f35b7805a4cd3a8820d00a76919dc470141 (patch)
tree220b200eb9a0f91fbbaba892e01608a51f5ddfd4 /lodepng_fuzzer.cpp
parent2c691de6557c4bcc99aa83234527e8db39d5917d (diff)
Removed Seed and improved Fuzzer's color selection
1. Removed the seed corpus and uploaded it to Google Cloud bucket to directly download from the oss-fuzz docker. 2. Made random color selection of fuzzer based on the last byte of the input instead of the first byte as first byte of png file is always fixed.
Diffstat (limited to 'lodepng_fuzzer.cpp')
-rw-r--r--lodepng_fuzzer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lodepng_fuzzer.cpp b/lodepng_fuzzer.cpp
index 0c7642e..00a0b7a 100644
--- a/lodepng_fuzzer.cpp
+++ b/lodepng_fuzzer.cpp
@@ -58,7 +58,11 @@ unsigned testDecode(lodepng::State& state, const uint8_t* data, size_t size) {
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if(size == 0) return 0;
- size_t random_color_type = data[0] % num_combinations;
+
+ // Setting last byte of input as random_color_type
+ // Fuzzer will still be able to mutate the data accordingly as
+ // last byte of png file can be changed and file will still remain valid.
+ size_t random_color_type = data[size-1] % num_combinations;
lodepng::State state;