From c0fe486c0f3dddd20f210fc6582101bf38ad5bff Mon Sep 17 00:00:00 2001 From: "Christian R. Helmrich" Date: Tue, 25 Oct 2022 01:00:00 +0200 Subject: [PATCH] fix MSYS issue #26 --- src/lib/bitAllocation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/bitAllocation.cpp b/src/lib/bitAllocation.cpp index 159ba87..c738e1c 100644 --- a/src/lib/bitAllocation.cpp +++ b/src/lib/bitAllocation.cpp @@ -110,7 +110,7 @@ uint16_t BitAllocator::getRateCtrlFac (const int32_t rateRatio, const unsigned s (m_rateIndex == 2 ? 1 << 12 : 0); // rate tuning const uint16_t mSfmSqr = (m_rateIndex <= 2 && samplingRate >= 27713 ? (specFlatness * specFlatness) >> m_rateIndex : 0); #else - const uint32_t brRatio = __max (1 << 15, __min (USHRT_MAX, rateRatio * (36 - 9 * m_rateIndex))); + const uint32_t brRatio = __max (1 << 15, __min ((1 << 16) - 1, rateRatio * (36 - 9 * m_rateIndex))); const uint16_t mSfmSqr = (m_rateIndex < 2 && samplingRate >= 27713 ? (specFlatness * specFlatness) >> m_rateIndex : 0); #endif const uint16_t mSfmFac = 256 - (((32 + m_rateIndex) * (specFlatness << 4) - mSfmSqr + (1 << 9)) >> 10);