``` rust extern crate mp4parse; use std::io::Cursor; fn main() { let mut c = Cursor::new(b"\x00\x00\x00\x04\xa6\x00\x04\xa6".to_vec()); let mut context = mp4parse::MediaContext::new(); let _ = mp4parse::read_box(&mut c, &mut context); } ``` ``` coreyf@frewbook-pro /t/mp4 (master) [101]> cargo run Compiling mp4 v0.1.0 (file:///private/tmp/mp4) Running `target/debug/mp4` thread '<main>' panicked at 'invalid box size', /private/tmp/mp4parse-rust/src/lib.rs:233 Process didn't exit successfully: `target/debug/mp4` (exit code: 101) ``` panic discovered using [afl.rs](https://github.com/frewsxcv/afl.rs)
Activity
rillian commentedon Oct 26, 2015
Thanks for fuzzing! Can you please attach the test case so we can verify fixes?
frewsxcv commentedon Oct 26, 2015
The test case is in the first codeblock in my original post, unless you're talking about something else?
rillian commentedon Oct 26, 2015
Oh, right. Sorry, didn't expect the test to be so short!
Add regression tests from fuzzing test cases.
rillian commentedon Oct 27, 2015
Fixed in 9eca3e7. I also included your testcase as a regression test in e97cf8a. Hope that's ok with you, @frewsxcv?
frewsxcv commentedon Oct 27, 2015
Sounds great! Should I continue to fuzz or is the project not ready for it yet?
rillian commentedon Oct 27, 2015
Fuzzing it welcome. We can find some of these panic!s with valid files, but this is more general.
Add regression tests from fuzzing test cases.