From 4bed03a65e33c503c3a055847b0017f086d164bb Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 9 Jan 2026 18:51:02 +1000 Subject: [PATCH] Fix a bug in ma_prev_power_of_2(). --- miniaudio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index 1a34f233..cb6b4898 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -13240,7 +13240,7 @@ static MA_INLINE void ma_zero_memory_64(void* dst, ma_uint64 sizeInBytes) static MA_INLINE unsigned int ma_prev_power_of_2(unsigned int x) { - return ma_next_power_of_2(x) >> 1; + return ma_next_power_of_2(x + 1) >> 1; } static MA_INLINE unsigned int ma_round_to_power_of_2(unsigned int x)