aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1
diff options
context:
space:
mode:
authorTorbjörn Andersson2007-04-09 10:07:36 +0000
committerTorbjörn Andersson2007-04-09 10:07:36 +0000
commita4fb87b98784839e433f60aacf16722b7b7ce1c4 (patch)
treedf4706d548510140ddeb91489ec3dcc2b51b2e5e /engines/sword1
parenta0dbf44ee1b98231b9c47a978302355b5618050d (diff)
downloadscummvm-rg350-a4fb87b98784839e433f60aacf16722b7b7ce1c4.tar.gz
scummvm-rg350-a4fb87b98784839e433f60aacf16722b7b7ce1c4.tar.bz2
scummvm-rg350-a4fb87b98784839e433f60aacf16722b7b7ce1c4.zip
Fixed crash when playing looping WAV music.
svn-id: r26425
Diffstat (limited to 'engines/sword1')
-rw-r--r--engines/sword1/music.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp
index f23b073b58..6a119ac5ec 100644
--- a/engines/sword1/music.cpp
+++ b/engines/sword1/music.cpp
@@ -100,7 +100,7 @@ int WaveAudioStream::readBuffer(int16 *buffer, const int numSamples) {
int retVal = 0;
while (retVal < numSamples && _samplesLeft > 0) {
- int samples = MIN((int)_samplesLeft, numSamples);
+ int samples = MIN((int)_samplesLeft, numSamples - retVal);
retVal += samples;
_samplesLeft -= samples;
while (samples > 0) {