aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2008-02-02 18:31:07 +0000
committerFilippos Karapetis2008-02-02 18:31:07 +0000
commit97eb13c22fbb23c31a3158317bcbf6ef44143490 (patch)
treee2f0fe3918b08be4770e8ee2d7100706db10de5f
parent97ef53a65258cfe43bfb5b2f5d1364e4b4cf82c5 (diff)
downloadscummvm-rg350-97eb13c22fbb23c31a3158317bcbf6ef44143490.tar.gz
scummvm-rg350-97eb13c22fbb23c31a3158317bcbf6ef44143490.tar.bz2
scummvm-rg350-97eb13c22fbb23c31a3158317bcbf6ef44143490.zip
Corrected an off-by-one error introduced with the latest cleanups
svn-id: r30743
-rw-r--r--sound/adpcm.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/adpcm.cpp b/sound/adpcm.cpp
index ec5ced6b19..4455288be4 100644
--- a/sound/adpcm.cpp
+++ b/sound/adpcm.cpp
@@ -211,22 +211,22 @@ int ADPCMInputStream::readBufferMS(int channels, int16 *buffer, const int numSam
while (samples < numSamples && !_stream->eos() && _stream->pos() < _endpos) {
if (_blockPos == _blockAlign) {
// read block header
- for (i = 0; i <= channels; i++) {
+ for (i = 0; i < channels; i++) {
_status.ch[i].predictor = CLIP(_stream->readByte(), (byte)0, (byte)6);
_status.ch[i].coeff1 = MSADPCMAdaptCoeff1[_status.ch[i].predictor];
_status.ch[i].coeff2 = MSADPCMAdaptCoeff2[_status.ch[i].predictor];
}
- for (i = 0; i <= channels; i++)
+ for (i = 0; i < channels; i++)
_status.ch[i].delta = _stream->readSint16LE();
- for (i = 0; i <= channels; i++)
+ for (i = 0; i < channels; i++)
_status.ch[i].sample1 = _stream->readSint16LE();
- for (i = 0; i <= channels; i++)
+ for (i = 0; i < channels; i++)
buffer[samples++] = _status.ch[i].sample2 = _stream->readSint16LE();
- for (i = 0; i <= channels; i++)
+ for (i = 0; i < channels; i++)
buffer[samples++] = _status.ch[i].sample1;
_blockPos = channels * 7;