Skip to content

Commit

Permalink
Merge pull request #357 from NhanNguyen700/fix-number-overflow-when-g…
Browse files Browse the repository at this point in the history
…etting-sample-dts

Fix Number overflow when getting sample DTS
  • Loading branch information
tobbee authored Jun 12, 2024
2 parents 4c795c0 + 0983f2e commit a7c4a43
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 a7c4a43

Please sign in to comment.