aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/adpcm.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/adpcm.cpp b/sound/adpcm.cpp
index bae635547e..e777a243b2 100644
--- a/sound/adpcm.cpp
+++ b/sound/adpcm.cpp
@@ -166,8 +166,8 @@ int16 ADPCMInputStream::decodeOKI(byte code) {
_status.stepIndex += stepAdjust(code);
if (_status.stepIndex < 0)
_status.stepIndex = 0;
- if (_status.stepIndex > 48)
- _status.stepIndex = 48;
+ if (_status.stepIndex > ARRAYSIZE(okiStepSize) - 1)
+ _status.stepIndex = ARRAYSIZE(okiStepSize) - 1;
// * 16 effectively converts 12-bit input to 16-bit output
return samp * 16;
@@ -213,8 +213,8 @@ int16 ADPCMInputStream::decodeMSIMA(byte code) {
_status.stepIndex += stepAdjust(code);
if (_status.stepIndex < 0)
_status.stepIndex = 0;
- if (_status.stepIndex > 88)
- _status.stepIndex = 88;
+ if (_status.stepIndex > ARRAYSIZE(imaStepTable) - 1)
+ _status.stepIndex = ARRAYSIZE(imaStepTable) - 1;
return samp;
}