From 03bf901a4bb4cb71fb899a06b17c9932e541d3e4 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 11 Mar 2024 15:41:52 +0100 Subject: Fix wrong clamping in u8 format converter See issue #55 --- src/FormatConverter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/FormatConverter.cpp b/src/FormatConverter.cpp index fc4cc2f..e8e76ed 100644 --- a/src/FormatConverter.cpp +++ b/src/FormatConverter.cpp @@ -78,8 +78,8 @@ int FormatConverter::process(Buffer* const dataIn, Buffer* dataOut) out[i] = 0; num_clipped_samples++; } - else if (samp > INT8_MAX) { - out[i] = INT8_MAX; + else if (samp > UINT8_MAX) { + out[i] = UINT8_MAX; num_clipped_samples++; } else { -- cgit v1.2.3