[Scummvm-git-logs] scummvm master -> 53da0c81708d97eed1572282580ec40cf69df0db
moralrecordings
code at moral.net.au
Sun Nov 7 03:59:25 UTC 2021
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:
53da0c8170 DIRECTOR: Fix file handle leak in getAudioStream
Commit: 53da0c81708d97eed1572282580ec40cf69df0db
https://github.com/scummvm/scummvm/commit/53da0c81708d97eed1572282580ec40cf69df0db
Author: Scott Percival (code at moral.net.au)
Date: 2021-11-07T11:57:29+08:00
Commit Message:
DIRECTOR: Fix file handle leak in getAudioStream
Changed paths:
engines/director/sound.cpp
diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index 41e06bfd1c..abb614125b 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -775,6 +775,7 @@ Audio::AudioStream *AudioFileDecoder::getAudioStream(bool looping, bool forPuppe
Common::File *file = new Common::File();
if (!file->open(Common::Path(pathMakeRelative(_path), g_director->_dirSeparator))) {
warning("Failed to open %s", _path.c_str());
+ delete file;
return nullptr;
}
uint32 magic1 = file->readUint32BE();
@@ -791,6 +792,7 @@ Audio::AudioStream *AudioFileDecoder::getAudioStream(bool looping, bool forPuppe
stream = Audio::makeAIFFStream(file, disposeAfterUse);
} else {
warning("Unknown file type for %s", _path.c_str());
+ delete file;
}
if (stream) {
More information about the Scummvm-git-logs
mailing list