Commit b9c2509d authored by David Reid's avatar David Reid

Fix an overflow bug in the s16 biquad pipeline.

parent 040dcf8d
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment