mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 09:14:04 +02:00
Fix an overflow bug in the s16 biquad pipeline.
This commit is contained in:
+1
-1
@@ -249,7 +249,7 @@ static MA_INLINE void ma_biquad_process_pcm_frame_s16__direct_form_2_transposed(
|
||||
r1 = b1*x - a1*y + r2;
|
||||
r2 = b2*x - a2*y;
|
||||
|
||||
pY[c] = (ma_int16)(y * 32767.0f); /* f32 -> s16 */
|
||||
pY[c] = (ma_int16)ma_clamp((ma_int32)(y * 32767.0f), -32768, 32767); /* f32 -> s16 */
|
||||
pBQ->r1[c].f32 = r1;
|
||||
pBQ->r2[c].f32 = r2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user