Skip to content

fix: ensure mime box is large enough to read#402

Merged
tobbee merged 1 commit intoEyevinn:masterfrom
fancybits:fix-mime-box
Jan 20, 2025
Merged

fix: ensure mime box is large enough to read#402
tobbee merged 1 commit intoEyevinn:masterfrom
fancybits:fix-mime-box

Conversation

@eric
Copy link
Contributor

@eric eric commented Jan 19, 2025

Fix the panic found by fuzzing:

--- FAIL: FuzzDecodeBox (478.19s)
    --- FAIL: FuzzDecodeBox (0.00s)
        testing.go:1591: panic: runtime error: index out of range [-1]
            goroutine 4015806 [running]:
            runtime/debug.Stack()
            	/opt/homebrew/Cellar/go/1.23.1/libexec/src/runtime/debug/stack.go:26 +0xc4
            testing.tRunner.func1()
            	/opt/homebrew/Cellar/go/1.23.1/libexec/src/testing/testing.go:1591 +0x21c
            panic({0x1030bc1a0?, 0x1400a1521f8?})
            	/opt/homebrew/Cellar/go/1.23.1/libexec/src/runtime/panic.go:785 +0x124
            github.com/Eyevinn/mp4ff/mp4.DecodeMimeSR({{0x1400a68e9e0?, 0x1400a6a3f20?}, 0x1400a68e9e0?, 0x8?}, 0x14009e8c658?, {0x1030df818, 0x1400a68cd40})
            	/Users/eric/src/mp4ff/mp4/mime.go:35 +0x214
            github.com/Eyevinn/mp4ff/mp4.DecodeMime({{0x1400a68e9e0?, 0x140001207b0?}, 0x1400a68e9e0?, 0x4?}, 0x0, {0x1030d8da0?, 0x1400a6a3f20?})
            	/Users/eric/src/mp4ff/mp4/mime.go:24 +0x184
            github.com/Eyevinn/mp4ff/mp4.DecodeBox(0x0, {0x1030d8da0, 0x1400a6a3f20})
            	/Users/eric/src/mp4ff/mp4/box.go:315 +0x178
            github.com/Eyevinn/mp4ff/mp4.FuzzDecodeBox.func1(0x1400a6c29c0, {0x1400a112d80, 0xc, 0x10})
            	/Users/eric/src/mp4ff/mp4/fuzz_test.go:65 +0x14c

Copy link
Collaborator

@tobbee tobbee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, except the description of the size.

@tobbee tobbee merged commit fa56081 into Eyevinn:master Jan 20, 2025
8 checks passed
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