Skip to content

Commit

Permalink
fix: potential overflow in size check for stco
Browse files Browse the repository at this point in the history
  • Loading branch information
eric committed Jan 15, 2025
1 parent f0fbacb commit 484b6cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mp4/stco.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (b *StcoBox) Size() uint64 {

// expectedSize - calculate size for a given entry count
func (b *StcoBox) expectedSize(entryCount uint32) uint64 {
return uint64(boxHeaderSize + 8 + int(entryCount)*4) // 8 = version + flags(4) + entryCount(4), 4 bytes per offset
return uint64(boxHeaderSize + 8 + uint64(entryCount)*4) // 8 = version + flags(4) + entryCount(4), 4 bytes per offset
}

// Encode - write box to w
Expand Down

0 comments on commit 484b6cf

Please sign in to comment.