[Scummvm-git-logs] scummvm master -> 36f3797f02072afe8920c007422d52f6f326abbe

sev- noreply at scummvm.org
Wed May 10 07:53:40 UTC 2023


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

Summary:
036297b605 DIRECTOR: Fix use-after-free
b8207b5f08 DIRECTOR: Ignore Xtra files
36f3797f02 DIRECTOR: Accept DRCF as config instead if VWCF


Commit: 036297b605dbaf4894a3ea2c560d99a53e84c092
    https://github.com/scummvm/scummvm/commit/036297b605dbaf4894a3ea2c560d99a53e84c092
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-05-10T09:53:36+02:00

Commit Message:
DIRECTOR: Fix use-after-free

Changed paths:
    engines/director/archive.cpp


diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 8b14fe2ddbf..885d68157c1 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -570,6 +570,7 @@ 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;
 	}
 
@@ -641,8 +642,10 @@ 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)
+	if (!readMapSuccess) {
+		_stream = nullptr;
 		return false;
+	}
 
 	if (_rifxType == MKTAG('A', 'P', 'P', 'L')) {
 		if (hasResource(MKTAG('F', 'i', 'l', 'e'), -1)) {
@@ -654,6 +657,7 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
 			return openStream(_stream, fileOffset);
 		} else {
 			warning("No 'File' resource present in APPL archive");
+			_stream = nullptr;
 			return false;
 		}
 	}


Commit: b8207b5f0853c4b85fbd3c265f152c433586756a
    https://github.com/scummvm/scummvm/commit/b8207b5f0853c4b85fbd3c265f152c433586756a
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-05-10T09:53:36+02:00

Commit Message:
DIRECTOR: Ignore Xtra files

Changed paths:
    engines/director/archive.cpp


diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 885d68157c1..8940366e7fa 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -650,16 +650,27 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
 	if (_rifxType == MKTAG('A', 'P', 'P', 'L')) {
 		if (hasResource(MKTAG('F', 'i', 'l', 'e'), -1)) {
 			// Replace this archive with the embedded archive.
-			uint32 fileId = getResourceIDList(MKTAG('F', 'i', 'l', 'e'))[0];
-			int32 fileOffset = _resources[fileId]->offset;
-			_types.clear();
-			_resources.clear();
-			return openStream(_stream, fileOffset);
-		} else {
-			warning("No 'File' resource present in APPL archive");
-			_stream = nullptr;
-			return false;
+			Common::Array<uint16> subFiles = getResourceIDList(MKTAG('F', 'i', 'l', 'e'));
+			uint numFile;
+			int32 fileOffset = 0;
+			for (numFile = 0; numFile < subFiles.size(); numFile++) {
+				uint32 fileId = subFiles[numFile];
+				fileOffset = _resources[fileId]->offset;
+				endianStream.seek(fileOffset + 8);
+				uint32 tag = endianStream.readUint32();
+				if (tag != MKTAG('X', 't', 'r', 'a') && tag != MKTAG('a', 'r', 't', 'X'))
+					break;
+			}
+			if (numFile < subFiles.size()) {
+				_types.clear();
+				_resources.clear();
+				return openStream(_stream, fileOffset);
+			}
 		}
+
+		warning("No 'File' resource present in APPL archive");
+		_stream = nullptr;
+		return false;
 	}
 
 	if (ConfMan.getBool("dump_scripts")) {


Commit: 36f3797f02072afe8920c007422d52f6f326abbe
    https://github.com/scummvm/scummvm/commit/36f3797f02072afe8920c007422d52f6f326abbe
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-05-10T09:53:36+02:00

Commit Message:
DIRECTOR: Accept DRCF as config instead if VWCF

Changed paths:
    engines/director/cast.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 61be6da86e1..7f2ec709d9f 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -249,6 +249,8 @@ bool Cast::loadConfig() {
 	}
 	Common::SeekableReadStreamEndian *stream = nullptr;
 	stream = _castArchive->getMovieResourceIfPresent(MKTAG('V', 'W', 'C', 'F'));
+	if (!stream)
+		stream = _castArchive->getMovieResourceIfPresent(MKTAG('D', 'R', 'C', 'F'));
 	if (!stream) {
 		warning("Cast::loadConfig(): Wrong format. VWCF resource missing");
 		return false;




More information about the Scummvm-git-logs mailing list