From 0983f2ed6164c906494b5ea1ee474609e3da6b38 Mon Sep 17 00:00:00 2001 From: Nhan Nguyen Date: Wed, 12 Jun 2024 14:10:41 +0700 Subject: [PATCH] fix: Number overflow when getting sample DTS --- mp4/stts.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mp4/stts.go b/mp4/stts.go index 71cf5085..4d2408ea 100644 --- a/mp4/stts.go +++ b/mp4/stts.go @@ -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 }