afl.rs 535 B

12345678910111213141516171819202122232425262728
  1. extern crate mp4parse;
  2. #[cfg(feature = "fuzz")]
  3. #[macro_use]
  4. extern crate abort_on_panic;
  5. use std::io::{Cursor, Read};
  6. fn doit() -> bool {
  7. let mut input = Vec::new();
  8. std::io::stdin().read_to_end(&mut input).unwrap();
  9. let mut reader = Cursor::new(&input);
  10. let mut context = mp4parse::MediaContext::new();
  11. return mp4parse::read_mp4(&mut reader, &mut context).is_ok();
  12. }
  13. #[cfg(feature = "fuzz")]
  14. fn main() {
  15. abort_on_panic!({
  16. doit();
  17. });
  18. }
  19. #[cfg(not(feature = "fuzz"))]
  20. fn main() {
  21. doit();
  22. }