aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/res_snd.cpp
diff options
context:
space:
mode:
authorTravis Howell2009-04-20 05:19:42 +0000
committerTravis Howell2009-04-20 05:19:42 +0000
commite15dd070f8bf38c9a2d209f3f554d4db689b9f91 (patch)
tree5b9837198d2fa9aedd42ead194b5887518c15444 /engines/agos/res_snd.cpp
parent56e50ed97880d8c342a03afd7b9c678601d0935f (diff)
downloadscummvm-rg350-e15dd070f8bf38c9a2d209f3f554d4db689b9f91.tar.gz
scummvm-rg350-e15dd070f8bf38c9a2d209f3f554d4db689b9f91.tar.bz2
scummvm-rg350-e15dd070f8bf38c9a2d209f3f554d4db689b9f91.zip
Fix sound effects regression in Waxworks.
svn-id: r40023
Diffstat (limited to 'engines/agos/res_snd.cpp')
-rw-r--r--engines/agos/res_snd.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp
index 891e183d4f..27c669b1e2 100644
--- a/engines/agos/res_snd.cpp
+++ b/engines/agos/res_snd.cpp
@@ -533,35 +533,36 @@ void AGOSEngine::loadSound(uint16 sound, uint16 freq, uint16 flags) {
dst = _curSfxFile;
if (getGameType() == GType_WW) {
- uint tmp = sound;
+ uint16 tmp = sound;
+
while (tmp--) {
- dst += READ_LE_UINT16(dst) + 4;
size += READ_LE_UINT16(dst) + 4;
+ dst += READ_LE_UINT16(dst) + 4;
if (size > _curSfxFileSize)
- error("loadSound: Reading beyond EOF");
+ error("loadSound: Reading beyond EOF (%d, %d)", size, _curSfxFileSize);
}
size = READ_LE_UINT16(dst);
offs = 4;
} else if (getGameType() == GType_ELVIRA2) {
while (READ_BE_UINT32(dst + 4) != sound) {
- dst += 12;
size += 12;
+ dst += 12;
if (size > _curSfxFileSize)
- error("loadSound: Reading beyond EOF");
+ error("loadSound: Reading beyond EOF (%d, %d)", size, _curSfxFileSize);
}
size = READ_BE_UINT32(dst);
offs = READ_BE_UINT32(dst + 8);
} else {
while (READ_BE_UINT16(dst + 6) != sound) {
- dst += 12;
size += 12;
+ dst += 12;
if (size > _curSfxFileSize)
- error("loadSound: Reading beyond EOF");
+ error("loadSound: Reading beyond EOF (%d, %d)", size, _curSfxFileSize);
}