Skip to content

Commit

Permalink
fix: Number overflow when getting sample DTS
Browse files Browse the repository at this point in the history
  • Loading branch information
NhanNguyen700 committed Jun 12, 2024
1 parent 4c795c0 commit 0983f2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mp4/stts.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ func (b *SttsBox) GetDecodeTime(sampleNr uint32) (decTime uint64, dur uint32) {
for {
dur = b.SampleTimeDelta[i]
if samplesRemaining >= b.SampleCount[i] {
decTime += uint64(b.SampleCount[i] * dur)
decTime += uint64(b.SampleCount[i]) * uint64(dur)
samplesRemaining -= b.SampleCount[i]
} else {
if samplesRemaining > 0 {
decTime += uint64(samplesRemaining * dur)
decTime += uint64(samplesRemaining) * uint64(dur)
}
break
}
Expand Down

0 comments on commit 0983f2e

Please sign in to comment.