Skip to content

Commit

Permalink
Add targets for RazrFalcon/usvg
Browse files Browse the repository at this point in the history
  • Loading branch information
killercup committed Apr 26, 2018
1 parent 09df1e7 commit 9b795d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ zip = { git = "https://github.com/mvdnes/zip-rs" }
zopfli = { git = "https://github.com/carols10cents/zopfli" }
svgtypes = { git = "https://github.com/RazrFalcon/svgtypes" }
xmlparser = { git = "https://github.com/RazrFalcon/xmlparser" }
usvg = { git = "https://github.com/RazrFalcon/usvg" }
10 changes: 10 additions & 0 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ extern crate zip;
extern crate zopfli;
extern crate svgtypes;
extern crate xmlparser;
extern crate usvg;

#[inline(always)]
pub fn fuzz_brotli_read(data: &[u8]) {
Expand Down Expand Up @@ -883,3 +884,12 @@ pub fn fuzz_xmlparser_xml(data: &[u8]) {
}
}
}

#[inline(always)]
pub fn fuzz_usvg_parse_tree(data: &[u8]) {
use std::str;

if let Ok(text) = str::from_utf8(data) {
let _ = usvg::parse_tree_from_data(text, &usvg::Options::default());
}
}

0 comments on commit 9b795d7

Please sign in to comment.