1
1
mirror of https://github.com/wader/fq.git synced 2024-11-26 21:55:57 +03:00

mp4: fuzz: Make sure stsz has sane number of entries on constant sample size

Should be redone to not use an array
This commit is contained in:
Mattias Wadman 2021-12-09 13:00:10 +01:00
parent f3480026bf
commit 62785291fe

View File

@ -539,6 +539,11 @@ func init() {
}) })
} else { } else {
if ctx.currentTrack != nil { 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++ { for i := uint64(0); i < entryCount; i++ {
ctx.currentTrack.stsz = append(ctx.currentTrack.stsz, uint32(sampleSize)) ctx.currentTrack.stsz = append(ctx.currentTrack.stsz, uint32(sampleSize))
} }