[Scummvm-git-logs] scummvm master -> 18d740fedd0ee6d7b01c97944fa72471e3210a6c
sev-
noreply at scummvm.org
Thu May 11 22:12:01 UTC 2023
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:
18d740fedd DIRECTOR: Redo "Fix use-after-free"
Commit: 18d740fedd0ee6d7b01c97944fa72471e3210a6c
https://github.com/scummvm/scummvm/commit/18d740fedd0ee6d7b01c97944fa72471e3210a6c
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-05-12T00:11:58+02:00
Commit Message:
DIRECTOR: Redo "Fix use-after-free"
This reverts commit 036297b605dbaf4894a3ea2c560d99a53e84c092.
Then it solves the same problem in a way that is more compliant
with how similar code is written in this engine thus avioding
accidentally introduced memory leak.
Changed paths:
engines/director/archive.cpp
engines/director/resource.cpp
diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 8940366e7fa..240e2ab62f1 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -570,7 +570,6 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
_isBigEndian = false;
} else {
warning("RIFXArchive::openStream(): RIFX or XFIR expected but %s found", tag2str(headerTag));
- _stream = nullptr;
return false;
}
@@ -642,10 +641,8 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
delete dumpStream;
// If we couldn't read the map, we can't do anything past this point.
- if (!readMapSuccess) {
- _stream = nullptr;
+ if (!readMapSuccess)
return false;
- }
if (_rifxType == MKTAG('A', 'P', 'P', 'L')) {
if (hasResource(MKTAG('F', 'i', 'l', 'e'), -1)) {
@@ -669,7 +666,6 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
}
warning("No 'File' resource present in APPL archive");
- _stream = nullptr;
return false;
}
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 67f9611c939..b9ece548774 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -302,6 +302,11 @@ Archive *Window::loadEXE(const Common::String movie) {
delete exeStream;
return nullptr;
}
+
+ if (result)
+ result->setPathName(movie);
+
+ return result;
}
if (result)
More information about the Scummvm-git-logs
mailing list