aboutsummaryrefslogtreecommitdiff
path: root/video/smk_decoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'video/smk_decoder.cpp')
-rw-r--r--video/smk_decoder.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp
index 4e18268e72..b622a0ab61 100644
--- a/video/smk_decoder.cpp
+++ b/video/smk_decoder.cpp
@@ -821,8 +821,9 @@ void SmackerDecoder::SmackerAudioTrack::queueCompressedBuffer(byte *buffer, uint
// (the exact opposite to the base values)
if (!is16Bits) {
for (int k = 0; k < (isStereo ? 2 : 1); k++) {
- bases[k] += (int8) ((int16) audioTrees[k]->getCode(audioBS));
- *curPointer++ = CLIP<int>(bases[k], 0, 255) ^ 0x80;
+ int8 delta = (int8) ((int16) audioTrees[k]->getCode(audioBS));
+ bases[k] = (bases[k] + delta) & 0xFF;
+ *curPointer++ = bases[k] ^ 0x80;
curPos++;
}
} else {