Skip to content

Commit

Permalink
Fix fuzzer target and bump version (#91)
Browse files Browse the repository at this point in the history
* Fix fuzzing target and bump the nuget version

* Revert "Fix fuzzing target and bump the nuget version"

This reverts commit bfde3db.

* Fix fuzzing target and bump the nuget version

---------

Co-authored-by: Gadi Brovman <gbrovman@microsoft.com>
  • Loading branch information
gbrovman and Gadi Brovman committed Jul 12, 2024
1 parent 025563f commit 85dd62e
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 59 deletions.
159 changes: 103 additions & 56 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions fuzz/fuzz_targets/fuzz_target_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ fuzz_target!(|data: &[u8]| {

let mut output = Vec::new();

let use_16bit_dc_estimate = match data.len() % 2 { 0 => false, _ => true };
let use_16bit = match data.len() % 2 { 0 => false, _ => true };
let accept_invalid_dht = match (data.len() / 2) % 2 { 0 => false, _ => true };

// keep the jpeg dimensions small otherwise the fuzzer gets really slow
let features = EnabledFeatures {
progressive: true,
reject_dqts_with_zeros: true,
max_jpeg_height: 1024,
max_jpeg_width: 1024,
use_16bit_dc_estimate: use_16bit_dc_estimate,
use_16bit_dc_estimate: use_16bit,
use_16bit_adv_predict: use_16bit,
accept_invalid_dht: accept_invalid_dht
};

{
Expand Down
Loading

0 comments on commit 85dd62e

Please sign in to comment.