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

eriktorbjorn eriktorbjorn at telia.com
Mon Sep 6 06:10:59 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:
e14ffec25a COMMON: Fix _disposeFileHandle not being set


Commit: e14ffec25a71770cd3d7375ee9543b422e4e20fa
    https://github.com/scummvm/scummvm/commit/e14ffec25a71770cd3d7375ee9543b422e4e20fa
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-09-06T08:01:08+02:00

Commit Message:
COMMON: Fix _disposeFileHandle not being set

If there is a file handle, the clear() method checks if it should be
disposed of. However, the _disposeFileHandle variable was never set, so
it's unlikely that _exe was ever deleted. I found this out from a
Valgrind warning when quitting Buried in Time.

This seems like a very obvious fix to me, and as such it seems like a
good candidate for backporting to the release branch. On the other hand,
maybe there are cases where it worked by sheer, dumb luck? I'm not
familiar enough with where and how it is used.

Changed paths:
    common/winexe_ne.cpp


diff --git a/common/winexe_ne.cpp b/common/winexe_ne.cpp
index c81b16c76e..0f5ec73c26 100644
--- a/common/winexe_ne.cpp
+++ b/common/winexe_ne.cpp
@@ -52,6 +52,7 @@ bool NEResources::loadFromEXE(SeekableReadStream *stream, DisposeAfterUse::Flag
 		return false;
 
 	_exe = stream;
+	_disposeFileHandle = disposeFileHandle;
 
 	uint32 offsetResourceTable = getResourceTableOffset();
 	if (offsetResourceTable == 0xFFFFFFFF)




More information about the Scummvm-git-logs mailing list