[Scummvm-git-logs] scummvm master -> a2dc39d44420db8ed655945b2fd12254353e98c9

rvanlaar noreply at scummvm.org
Fri Oct 7 15:16:10 UTC 2022


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:
a2dc39d444 DIRECTOR: Fix unchecked return value


Commit: a2dc39d44420db8ed655945b2fd12254353e98c9
    https://github.com/scummvm/scummvm/commit/a2dc39d44420db8ed655945b2fd12254353e98c9
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-10-07T17:14:10+02:00

Commit Message:
DIRECTOR: Fix unchecked return value

Only try to open the datafork when `open` succeeded.

Fixes COVERITY: 1465739

Changed paths:
    engines/director/sound.cpp


diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index 9c21782022e..d18ce31db83 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -797,8 +797,12 @@ Audio::AudioStream *AudioFileDecoder::getAudioStream(bool looping, bool forPuppe
 	if (_path.empty())
 		return nullptr;
 
-	_macresman->open(Common::Path(pathMakeRelative(_path), g_director->_dirSeparator));
-	Common::SeekableReadStream *file = _macresman->getDataFork();
+	Common::Path filePath = Common::Path(pathMakeRelative(_path), g_director->_dirSeparator);
+	Common::SeekableReadStream *file = nullptr;
+
+	if (_macresman->open(filePath)) {
+		file = _macresman->getDataFork();
+	}
 
 	if (file == nullptr) {
 		warning("Failed to open %s", _path.c_str());




More information about the Scummvm-git-logs mailing list