[Scummvm-git-logs] scummvm master -> 1ff57a4c0f580de442ec986e5f46f4f2462a88d4

rvanlaar noreply at scummvm.org
Fri Sep 23 23:55:45 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:
1ff57a4c0f DIRECTOR: Fix segfault in D4 movies


Commit: 1ff57a4c0f580de442ec986e5f46f4f2462a88d4
    https://github.com/scummvm/scummvm/commit/1ff57a4c0f580de442ec986e5f46f4f2462a88d4
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-09-24T01:54:21+02:00

Commit Message:
DIRECTOR: Fix segfault in D4 movies

The exeStream should only be deleted in `loadExeV3`

One `loadExeV?` is not like the others. They all load RIFX files
except for the V3 variant. They all error on an error during the opening of
the stream, except voor the V3 variant.

The segfault was introduced in 12bb1a495fa5d98ef by fixing a memory leak
for the `exeStream`.

Changed paths:
    engines/director/resource.cpp


diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index bacfc8f9bf2..a855ffb70ce 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -270,8 +270,6 @@ void Window::loadEXE(const Common::String movie) {
 		}
 	}
 
-	delete exeStream;
-
 	if (_mainArchive)
 		_mainArchive->setPathName(movie);
 }
@@ -326,6 +324,7 @@ void Window::loadEXEv3(Common::SeekableReadStream *stream) {
 		warning("Failed to load RIFF from EXE");
 		delete _mainArchive;
 		_mainArchive = nullptr;
+		delete stream;
 	}
 
 	openMainArchive(mmmFileName);




More information about the Scummvm-git-logs mailing list