From 9ba72fa2f61bcf2920e434c582da9e4c9dec0955 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 19 Nov 2022 14:34:47 +1000 Subject: [PATCH] Fix a bug in ma_gainer. --- miniaudio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index 9cbb9006..b0996053 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -47963,7 +47963,7 @@ MA_API ma_result ma_gainer_process_pcm_frames(ma_gainer* pGainer, void* pFramesO /* Now that some frames have been processed we need to make sure future changes to the gain are interpolated. */ if (pGainer->t == (ma_uint32)-1) { - pGainer->t = pGainer->config.smoothTimeInFrames; + pGainer->t = (ma_uint32)ma_min(pGainer->config.smoothTimeInFrames, frameCount); }