[Scummvm-git-logs] scummvm master -> 79b4e0ae213f44415f631eacee861e4c3777c002

criezy criezy at scummvm.org
Mon Oct 19 00:14:38 UTC 2020


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

Summary:
20fb33a668 SWORD1: Fix use of uninitialized variables in PSX demo music
79b4e0ae21 MACOSX: Fix memory leak in dock tile plugin


Commit: 20fb33a668e6f14732b94092b8f069c18ca15ab1
    https://github.com/scummvm/scummvm/commit/20fb33a668e6f14732b94092b8f069c18ca15ab1
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-10-19T01:14:21+01:00

Commit Message:
SWORD1: Fix use of uninitialized variables in PSX demo music

The music tab file in the PSX demo seems to be truncated and we
were seeking beyond the end of the file for some music (such as
the one for the menu), and then trying to read without any checks
that either the seek or read succeeded. This caused the code to
then use uninitialized variables causing random issues (such as
getting some noise). We now ignore the music id that are beyond
the end of the broken tab file.

Changed paths:
    engines/sword1/music.cpp


diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp
index 6a0a3d1e70..428f42a418 100644
--- a/engines/sword1/music.cpp
+++ b/engines/sword1/music.cpp
@@ -121,7 +121,12 @@ bool MusicHandle::playPSX(uint16 id, bool loop) {
 	if (!tableFile.open("tunes.tab"))
 		return false;
 
-	tableFile.seek((id - 1) * 8, SEEK_SET);
+	// The PSX demo has a broken/truncated tunes.tab. So we check here that the offset is not
+	// beyond the end of the file.
+	int32 tableOffset = (id - 1) * 8;
+	if (tableOffset >= tableFile.size())
+		return false;
+	tableFile.seek(tableOffset, SEEK_SET);
 	uint32 offset = tableFile.readUint32LE() * 0x800;
 	uint32 size = tableFile.readUint32LE();
 


Commit: 79b4e0ae213f44415f631eacee861e4c3777c002
    https://github.com/scummvm/scummvm/commit/79b4e0ae213f44415f631eacee861e4c3777c002
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-10-19T01:14:21+01:00

Commit Message:
MACOSX: Fix memory leak in dock tile plugin

Changed paths:
    backends/taskbar/macosx/dockplugin/dockplugin.m


diff --git a/backends/taskbar/macosx/dockplugin/dockplugin.m b/backends/taskbar/macosx/dockplugin/dockplugin.m
index 95f961a39d..18e8ee5fc6 100644
--- a/backends/taskbar/macosx/dockplugin/dockplugin.m
+++ b/backends/taskbar/macosx/dockplugin/dockplugin.m
@@ -78,6 +78,7 @@
 		[menuItem release];
 	}
 
+	CFRelease(array);
 	return recentGamesMenu;
 }
 




More information about the Scummvm-git-logs mailing list