[Scummvm-git-logs] scummvm master -> 02722def86e6c9d2d6b8554a1f68d19c235a2d51

fracturehill noreply at scummvm.org
Sat Jun 22 19:31:02 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
02722def86 NANCY: Fix Vorbis sound reading


Commit: 02722def86e6c9d2d6b8554a1f68d19c235a2d51
    https://github.com/scummvm/scummvm/commit/02722def86e6c9d2d6b8554a1f68d19c235a2d51
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2024-06-22T21:30:39+02:00

Commit Message:
NANCY: Fix Vorbis sound reading

Vorbis-encoded .his sounds were being read incorrectly.
Specifically, the size property inside the headers was
assumed to refer to the size of the file's body; instead, it
appears to refer to the uncompressed size of the sound.
This would then cause an assertion in
MemorySubReadStream when extracting those files
from a compressed game variant, since the code was
attempting to seek to the "end" of a stream with a size
larger than the file it's coming from.

Changed paths:
    engines/nancy/sound.cpp


diff --git a/engines/nancy/sound.cpp b/engines/nancy/sound.cpp
index da9eb4b4d1b..01478486113 100644
--- a/engines/nancy/sound.cpp
+++ b/engines/nancy/sound.cpp
@@ -214,7 +214,10 @@ Audio::SeekableAudioStream *SoundManager::makeHISStream(Common::SeekableReadStre
 		}
 	}
 
-	Common::SeekableSubReadStream *subStream = new Common::SeekableSubReadStream(stream, stream->pos(), stream->pos() + size, disposeAfterUse);
+	Common::SeekableSubReadStream *subStream = new Common::SeekableSubReadStream(
+		stream, stream->pos(),
+		type == kSoundTypeOgg ? stream->size() : stream->pos() + size,
+		disposeAfterUse);
 
 	if (type == kSoundTypeRaw || type == kSoundTypeDiamondware)
 		return Audio::makeRawStream(subStream, overrideSamplesPerSec == 0 ? samplesPerSec : overrideSamplesPerSec, flags, DisposeAfterUse::YES);




More information about the Scummvm-git-logs mailing list