-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
target | ||
artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "adts-reader-fuzz" | ||
version = "0.0.1" | ||
authors = ["Automatically generated"] | ||
publish = false | ||
edition = "2021" | ||
|
||
[package.metadata] | ||
cargo-fuzz = true | ||
|
||
[dependencies] | ||
adts-reader = { path = ".." } | ||
libfuzzer-sys = "0.3" | ||
|
||
# Prevent this from interfering with workspaces | ||
[workspace] | ||
members = ["."] | ||
|
||
[[bin]] | ||
name = "fuzz_target_1" | ||
path = "fuzz_targets/fuzz_target_1.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Fuzz testing `adts-reader` | ||
|
||
## Setup | ||
|
||
If you don't already have [cargo-fuzz](https://rust-fuzz.github.io/book/introduction.html) installed. | ||
|
||
``` | ||
cargo +nightly install cargo-fuzz | ||
``` | ||
|
||
## Testing | ||
|
||
To perform fuzz testing, | ||
|
||
``` | ||
cargo +nightly fuzz run fuzz_target_1 | ||
``` | ||
|
||
(The fuzz test will keep running until it either finds a fault, or you kill the process.) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
fuzz/corpus/fuzz_target_1/5c10b5b2cd673a0616d529aa5234b12ee7153808
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
, |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#![no_main] | ||
#[macro_use] | ||
extern crate libfuzzer_sys; | ||
extern crate adts_reader; | ||
|
||
use adts_reader::*; | ||
|
||
struct NullConsumer {} | ||
|
||
impl AdtsConsumer for NullConsumer { | ||
fn new_config( | ||
&mut self, | ||
mpeg_version: MpegVersion, | ||
protection: ProtectionIndicator, | ||
aot: AudioObjectType, | ||
freq: SamplingFrequency, | ||
private_bit: u8, | ||
channels: ChannelConfiguration, | ||
originality: Originality, | ||
home: u8, | ||
) { | ||
} | ||
fn payload(&mut self, buffer_fullness: u16, number_of_blocks: u8, buf: &[u8]) {} | ||
fn error(&mut self, err: AdtsParseError) {} | ||
} | ||
|
||
fuzz_target!(|data: &[u8]| { | ||
let mut p = AdtsParser::new(NullConsumer {}); | ||
p.push(data); | ||
}); |