aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorWalter van Niftrik2009-06-04 16:18:35 +0000
committerWalter van Niftrik2009-06-04 16:18:35 +0000
commit3da455420a122a53b22329ed59297ba0428c1497 (patch)
treec388be7919381b7dfce9ebf75208d1c9e07939ab /engines/sci
parenta440d77408cf8e5cb4f570a3eeb0ee28338ab15d (diff)
downloadscummvm-rg350-3da455420a122a53b22329ed59297ba0428c1497.tar.gz
scummvm-rg350-3da455420a122a53b22329ed59297ba0428c1497.tar.bz2
scummvm-rg350-3da455420a122a53b22329ed59297ba0428c1497.zip
SCI: Audio: Fixed bug in reading of SOL header.
svn-id: r41171
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/resource.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 55059a1089..05dcf95bd0 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1487,6 +1487,12 @@ byte* readSOLAudio(Common::SeekableReadStream *audioStream, uint32 *size, uint16
}
int headerSize = audioStream->readByte();
+
+ if (headerSize != 11 && headerSize != 12) {
+ warning("SOL audio header of size %i not supported", headerSize);
+ return NULL;
+ }
+
audioStream->readUint32LE(); // skip "SOL" + 0 (4 bytes)
*audioRate = audioStream->readUint16LE();
audioFlags = audioStream->readByte();
@@ -1498,10 +1504,12 @@ byte* readSOLAudio(Common::SeekableReadStream *audioStream, uint32 *size, uint16
if (!(audioFlags & kSolFlagIsSigned))
*flags |= Audio::Mixer::FLAG_UNSIGNED;
- *size = audioStream->readUint16LE();
+ *size = audioStream->readUint32LE();
- if (headerSize == 12)
- *size |= audioStream->readByte() << 16;
+ if (headerSize == 12) {
+ // Unknown byte
+ audioStream->readByte();
+ }
byte *buffer;