Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Fuzzing support and some fixes #397

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

eric
Copy link

@eric eric commented Jan 6, 2025

I added fuzzing to test mp4.DecodeBox and discovered some issues with handling random/corrupted inputs.

You can run the fuzzer with:

$ go test -fuzz=FuzzDecodeBox ./mp4

and it will continue to run until it finds any new issues. Right now the only thing that it's looking for is a panic. When it does find a new test case that fails, it puts it in mp4/testdata/fuzz/FuzzDecodeBox/.

@tobbee
Copy link
Collaborator

tobbee commented Jan 7, 2025

@eric Thanks for your contribution. I'm not keen on making the code completely stable to all sorts of input, but I think most of your changes are OK. Something that is not OK is the max size of the box. Mdat boxes can be larger than 4GB for 4K movies and other case, which is the reason that there is an 8-byte extended size. I'll look a bit more later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants