Skip to content

Panic when using read_box #4

Description

@frewsxcv
extern crate mp4parse;

use std::io::Cursor;

fn main() {
    let mut c = Cursor::new(b"\x00\x00\x00\x01\x30\x30\x30\x30\x00\x00\x00\x00\x00\x00\x00\x00".to_vec());
    let mut context = mp4parse::MediaContext::new();
    let _ = mp4parse::read_box(&mut c, &mut context);
}
coreyf@frewbook-pro /t/mp4 (master)> cargo run
     Running `target/debug/mp4`
thread '<main>' panicked at 'assertion failed: size64 >= 16', /private/tmp/mp4parse-rust/src/lib.rs:273
Process didn't exit successfully: `target/debug/mp4` (exit code: 101)

panic discovered using afl.rs

Activity

  1. kinetiknz commented on Oct 28, 2015

    @kinetiknz
    Collaborator

    Thanks for the report. I've converted this into error return in kinetiknz@a60ea2d, Ralph will probably merge it tomorrow.

    Since this project is very early in development we've been using panics and asserts as placeholders for areas where more thought about the code is needed. Since that's going to make fuzzing difficult, I've converted the remaining ones into error returns in my branch... so it's probably worth testing against my branch at https://github.com/kinetiknz/mp4parse-rust/tree/experimental for now, at least until Ralph merges the changes upstream.

  2. rillian commented on Oct 28, 2015

    @rillian
    Contributor

    Thanks for that, kinetik. I've merged the changes and added this testcase in abb0f2b, confirming the fix. Hopefully the next one you find will be a real bug!

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