Skip to content

Commit

Permalink
Fix wrong clamping in u8 format converter
Browse files Browse the repository at this point in the history
See issue #55
  • Loading branch information
mpbraendli committed Mar 11, 2024
1 parent 01d8415 commit 03bf901
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FormatConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 03bf901

Please sign in to comment.