From a2c25378a970792461c961054e2b47cd3a086e05 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 9 May 2017 11:50:25 -0700 Subject: Reduce LIMITER_VALUE_MAX The previous value couldn't actually be expressed as a float and got rounded up to the next whole number value, leaving the potential for an overrun in the squared sum. --- OpenAL32/Include/alu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 8ac25e35..30b245a5 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -299,7 +299,7 @@ void DeinitVoice(ALvoice *voice); #define LIMITER_WINDOW_SIZE (1<<7) /* 128 */ #define LIMITER_WINDOW_MASK (LIMITER_WINDOW_SIZE-1) -#define LIMITER_VALUE_MAX (UINT_MAX / LIMITER_WINDOW_SIZE) +#define LIMITER_VALUE_MAX (1<<24) /* 16777216 */ struct OutputLimiter { /* RMS detection window, sum of values in the window, and the next write * pos. Values are 16.16 fixed-point. -- cgit v1.2.3