Merge "frameCountFromDurationUs: Avoid integer overflow" into main
This commit is contained in:
commit
4cf75592a3
1 changed files with 1 additions and 1 deletions
|
@ -175,7 +175,7 @@ constexpr U makeBitPositionFlagMask(std::initializer_list<E> flags) {
|
|||
}
|
||||
|
||||
constexpr int32_t frameCountFromDurationUs(long durationUs, int32_t sampleRateHz) {
|
||||
return (durationUs * sampleRateHz) / 1000000LL;
|
||||
return (static_cast<long long>(durationUs) * sampleRateHz) / 1000000LL;
|
||||
}
|
||||
|
||||
constexpr int32_t frameCountFromDurationMs(int32_t durationMs, int32_t sampleRateHz) {
|
||||
|
|
Loading…
Reference in a new issue