Skip to content

Commit

Permalink
fix: co64 could use too much memory of the size overflowed 32 bits
Browse files Browse the repository at this point in the history
  • Loading branch information
eric authored and tobbee committed Jan 20, 2025
1 parent 5fb4e82 commit 2330aaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mp4/co64.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (b *Co64Box) Type() string {
}

func (b *Co64Box) expectedSize(nrEntries uint32) uint64 {
return uint64(boxHeaderSize + 8 + nrEntries*8)
return uint64(boxHeaderSize + 8 + uint64(nrEntries)*8)
}

// Size - box-specific size
Expand Down
2 changes: 2 additions & 0 deletions mp4/testdata/fuzz/FuzzDecodeBox/7e07cf8cc85e7f41
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
go test fuzz v1
[]byte("\x00\x00\x00\x10co640000 \x00\x00\x00")

0 comments on commit 2330aaa

Please sign in to comment.