Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34f5b914 authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "frameCountFromDurationUs: Avoid integer overflow" into main am:...

Merge "frameCountFromDurationUs: Avoid integer overflow" into main am: 4cf75592 am: 9f1b5ace am: 544b54bd

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2824592



Change-Id: I72823ad4a6fe8663b12b43ab8f2c6750e2a235ab
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ad889118 544b54bd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {