Skip to content

Panic when using read_box #2

Closed
Closed

Description

@frewsxcv
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

Activity

  1. rillian commented on Oct 26, 2015

    @rillian
    Contributor

    Thanks for fuzzing! Can you please attach the test case so we can verify fixes?

  2. frewsxcv commented on Oct 26, 2015

    @frewsxcv
    ContributorAuthor

    The test case is in the first codeblock in my original post, unless you're talking about something else?

  3. rillian commented on Oct 26, 2015

    @rillian
    Contributor

    Oh, right. Sorry, didn't expect the test to be so short!

  4. rillian commented on Oct 27, 2015

    @rillian
    Contributor

    Fixed in 9eca3e7. I also included your testcase as a regression test in e97cf8a. Hope that's ok with you, @frewsxcv?

  5. frewsxcv commented on Oct 27, 2015

    @frewsxcv
    ContributorAuthor

    Sounds great! Should I continue to fuzz or is the project not ready for it yet?

  6. rillian commented on Oct 27, 2015

    @rillian
    Contributor

    Fuzzing it welcome. We can find some of these panic!s with valid files, but this is more general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions