diff options
author | Colin Snover | 2017-07-17 23:48:25 -0500 |
---|---|---|
committer | Colin Snover | 2017-07-17 23:56:21 -0500 |
commit | 64d090dcb82377daa09587f92b7c00c8f96b3a0c (patch) | |
tree | 75931ce5ee7ae4917ea677ec750c8d313b5da22e /engines | |
parent | ba4fccdb26ff050fad32d24956e9eba7e8fa6268 (diff) | |
download | scummvm-rg350-64d090dcb82377daa09587f92b7c00c8f96b3a0c.tar.gz scummvm-rg350-64d090dcb82377daa09587f92b7c00c8f96b3a0c.tar.bz2 scummvm-rg350-64d090dcb82377daa09587f92b7c00c8f96b3a0c.zip |
SCI32: Fix stream leaks in Audio32/SOLStream
makeSOLStream was leaking the SeekableSubReadStream object it
creates itself if it was not called with DisposeAfterUse::YES. That
substream is an implementation detail which should not rely on
the caller to be destroyed.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/sound/decoders/sol.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/sci/sound/decoders/sol.cpp b/engines/sci/sound/decoders/sol.cpp index d060faefb3..50d353cf18 100644 --- a/engines/sci/sound/decoders/sol.cpp +++ b/engines/sci/sound/decoders/sol.cpp @@ -254,20 +254,20 @@ Audio::SeekableAudioStream *makeSOLStream(Common::SeekableReadStream *stream, Di if (flags & kCompressed) { if (flags & kStereo && flags & k16Bit) { - return new SOLStream<true, true, false>(new Common::SeekableSubReadStream(stream, initialPosition, initialPosition + dataSize, disposeAfterUse), disposeAfterUse, sampleRate, dataSize); + return new SOLStream<true, true, false>(new Common::SeekableSubReadStream(stream, initialPosition, initialPosition + dataSize, disposeAfterUse), DisposeAfterUse::YES, sampleRate, dataSize); } else if (flags & kStereo) { if (getSciVersion() < SCI_VERSION_2_1_EARLY) { error("SCI2 and earlier did not support stereo SOL audio"); } - return new SOLStream<true, false, false>(new Common::SeekableSubReadStream(stream, initialPosition, initialPosition + dataSize, disposeAfterUse), disposeAfterUse, sampleRate, dataSize); + return new SOLStream<true, false, false>(new Common::SeekableSubReadStream(stream, initialPosition, initialPosition + dataSize, disposeAfterUse), DisposeAfterUse::YES, sampleRate, dataSize); } else if (flags & k16Bit) { - return new SOLStream<false, true, false>(new Common::SeekableSubReadStream(stream, initialPosition, initialPosition + dataSize, disposeAfterUse), disposeAfterUse, sampleRate, dataSize); + return new SOLStream<false, true, false>(new Common::SeekableSubReadStream(stream, initialPosition, initialPosition + dataSize, disposeAfterUse), DisposeAfterUse::YES, sampleRate, dataSize); } else { if (getSciVersion() < SCI_VERSION_2_1_EARLY) { - return new SOLStream<false, false, true>(new Common::SeekableSubReadStream(stream, initialPosition, initialPosition + dataSize, disposeAfterUse), disposeAfterUse, sampleRate, dataSize); + return new SOLStream<false, false, true>(new Common::SeekableSubReadStream(stream, initialPosition, initialPosition + dataSize, disposeAfterUse), DisposeAfterUse::YES, sampleRate, dataSize); } else { - return new SOLStream<false, false, false>(new Common::SeekableSubReadStream(stream, initialPosition, initialPosition + dataSize, disposeAfterUse), disposeAfterUse, sampleRate, dataSize); + return new SOLStream<false, false, false>(new Common::SeekableSubReadStream(stream, initialPosition, initialPosition + dataSize, disposeAfterUse), DisposeAfterUse::YES, sampleRate, dataSize); } } } |