aboutsummaryrefslogtreecommitdiff
path: root/sound/decoders/adpcm.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-28 21:05:10 +0000
committerJohannes Schickel2010-01-28 21:05:10 +0000
commit347a97460913930d9a4e638b085bfbc5755e10e3 (patch)
tree5e5e52c7b9bc78c23ba513f510594652694accea /sound/decoders/adpcm.cpp
parent9e511e0751f0324bc424b75e02d25a3a3a095053 (diff)
downloadscummvm-rg350-347a97460913930d9a4e638b085bfbc5755e10e3.tar.gz
scummvm-rg350-347a97460913930d9a4e638b085bfbc5755e10e3.tar.bz2
scummvm-rg350-347a97460913930d9a4e638b085bfbc5755e10e3.zip
Add some paranaoia assert (and a related TODO) to the MSIMA2 implementation.
svn-id: r47652
Diffstat (limited to 'sound/decoders/adpcm.cpp')
-rw-r--r--sound/decoders/adpcm.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/decoders/adpcm.cpp b/sound/decoders/adpcm.cpp
index 898780350b..7a15f118b3 100644
--- a/sound/decoders/adpcm.cpp
+++ b/sound/decoders/adpcm.cpp
@@ -332,6 +332,12 @@ int ADPCMInputStream::readBufferMSIMA2(int16 *buffer, const int numSamples) {
int nibble;
byte k;
+ // TODO: Currently this implementation only supports
+ // reading a multiple of 16 samples at once. We might
+ // consider changing that so it could read an arbitrary
+ // sample pair count.
+ assert(numSamples % 16 == 0);
+
for (samples = 0; samples < numSamples && !_stream->eos() && _stream->pos() < _endpos;) {
for (int channel = 0; channel < 2; channel++) {
data = _stream->readUint32LE();