Skip to content

Commit

Permalink
mp4: fuzz: Make sure stsz has sane number of entries on constant samp…
Browse files Browse the repository at this point in the history
…le size

Should be redone to not use an array
  • Loading branch information
wader committed Dec 9, 2021
1 parent f348002 commit 6278529
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions format/mp4/boxes.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,11 @@ func init() {
})
} else {
if ctx.currentTrack != nil {
// TODO: keep track of list of sampleSize/entries instead and change sample read code
const maxEntryCount = 10_000_000
if entryCount > maxEntryCount {
d.Errorf("too many constant stsz entries %d > %d", entryCount, maxEntryCount)
}
for i := uint64(0); i < entryCount; i++ {
ctx.currentTrack.stsz = append(ctx.currentTrack.stsz, uint32(sampleSize))
}
Expand Down

0 comments on commit 6278529

Please sign in to comment.