From 3da455420a122a53b22329ed59297ba0428c1497 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Thu, 4 Jun 2009 16:18:35 +0000 Subject: SCI: Audio: Fixed bug in reading of SOL header. svn-id: r41171 --- engines/sci/resource.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'engines/sci') 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; -- cgit v1.2.3