Skip to content

Commit

Permalink
Add harness
Browse files Browse the repository at this point in the history
  • Loading branch information
rnshah9 authored and ForAllSecure Mayhem Bot committed Aug 6, 2024
1 parent 0085821 commit 7062d94
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions mayhem/fuzz.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <stdint.h>
#include <stdio.h>
#include <climits>

#include <fuzzer/FuzzedDataProvider.h>

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
FuzzedDataProvider provider(data, size);
int src_width = provider.ConsumeIntegralInRange<int>(0, INT_MAX);
int src_height = provider.ConsumeIntegralInRange<int>(0, INT_MAX);
int dest_width_inout = provider.ConsumeIntegral<int>();
int dest_height_inout = provider.ConsumeIntegral<int>();
int font_ratio = provider.ConsumeFloatingPointInRange<float>(1, 100);
int zoom = provider.ConsumeIntegral<int>();
int stretch = provider.ConsumeIntegral<int>();

// chafa_calc_canvas_geometry(src_width, src_height, &dest_width_inout, &dest_height_inout, font_ratio, zoom, stretch);

return 0;
}

0 comments on commit 7062d94

Please sign in to comment.