[Scummvm-git-logs] scummvm branch-2-9 -> aecd533d3cc516f03cda308c02fb85e8e0c823bf

dwatteau noreply at scummvm.org
Tue Apr 29 17:08:29 UTC 2025


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

Summary:
f65f9c621f IMAGE: Fix undefined behaviours in Cinepak decoder
245fcbcb63 COMMON: Avoid valgrind errors when opening invalid ZIP files
7c4a96c59c BACKENDS: MACOS: Cleanup nullptr use in ObjC files
aecd533d3c BACKENDS: MACOS: Don't instantiate touch bar on old MacOS versions


Commit: f65f9c621fde2251ddd03c4eec8d994d6a4be3f9
    https://github.com/scummvm/scummvm/commit/f65f9c621fde2251ddd03c4eec8d994d6a4be3f9
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-04-29T18:00:57+02:00

Commit Message:
IMAGE: Fix undefined behaviours in Cinepak decoder

Left shifting a negative number is undefined (as it may eat the sign
bit).
Instead, multiply by 2 which is the same but properly defined.
Also fix the convertYUVToColor function signature as it takes int8
values.

(cherry picked from commit 532c112e4cd1f433843af7e449f2ff82c9973b61)

Changed paths:
    image/codecs/cinepak.cpp


diff --git a/image/codecs/cinepak.cpp b/image/codecs/cinepak.cpp
index d7c5dd8e656..c47c908999a 100644
--- a/image/codecs/cinepak.cpp
+++ b/image/codecs/cinepak.cpp
@@ -37,12 +37,12 @@ namespace Image {
 namespace {
 
 inline void convertYUVToRGB(const byte *clipTable, byte y, int8 u, int8 v, byte &r, byte &g, byte &b) {
-	r = clipTable[y + (v << 1)];
+	r = clipTable[y + (v * 2)];
 	g = clipTable[y - (u >> 1) - v];
-	b = clipTable[y + (u << 1)];
+	b = clipTable[y + (u * 2)];
 }
 
-inline uint32 convertYUVToColor(const byte *clipTable, const Graphics::PixelFormat &format, byte y, byte u, byte v) {
+inline uint32 convertYUVToColor(const byte *clipTable, const Graphics::PixelFormat &format, byte y, int8 u, int8 v) {
 	byte r, g, b;
 	convertYUVToRGB(clipTable, y, u, v, r, g, b);
 	return format.RGBToColor(r, g, b);


Commit: 245fcbcb63720f8a8e253b942dea1d0791d66c61
    https://github.com/scummvm/scummvm/commit/245fcbcb63720f8a8e253b942dea1d0791d66c61
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-04-29T18:02:15+02:00

Commit Message:
COMMON: Avoid valgrind errors when opening invalid ZIP files

Bail out of the function before jumping on values which failed to read.

(cherry picked from commit 1a4e4c1826fa79538c723a435d42171eadc65b38)

Changed paths:
    common/compression/unzip.cpp


diff --git a/common/compression/unzip.cpp b/common/compression/unzip.cpp
index 39276b1699d..4f0b79f66fb 100644
--- a/common/compression/unzip.cpp
+++ b/common/compression/unzip.cpp
@@ -488,6 +488,12 @@ unzFile unzOpen(Common::SeekableReadStream *stream, bool flattenTree) {
 	if (unzlocal_getShort(us->_stream, &number_entry_CD) != UNZ_OK)
 		err = UNZ_ERRNO;
 
+	if (err != UNZ_OK) {
+		delete us->_stream;
+		delete us;
+		return nullptr;
+	}
+
 	if ((number_entry_CD != us->gi.number_entry) ||
 	    (number_disk_with_CD != 0) ||
 	    (number_disk != 0))


Commit: 7c4a96c59cb1ffaa49746838ae817cad90a30464
    https://github.com/scummvm/scummvm/commit/7c4a96c59cb1ffaa49746838ae817cad90a30464
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-04-29T19:02:46+02:00

Commit Message:
BACKENDS: MACOS: Cleanup nullptr use in ObjC files

(cherry picked from commit 95c65cd30a42a626392fc93d6d3a7e1a81d42fcb)

Changed paths:
    backends/platform/sdl/macosx/macosx-touchbar.mm


diff --git a/backends/platform/sdl/macosx/macosx-touchbar.mm b/backends/platform/sdl/macosx/macosx-touchbar.mm
index c62909e6206..bd0ebb1135b 100644
--- a/backends/platform/sdl/macosx/macosx-touchbar.mm
+++ b/backends/platform/sdl/macosx/macosx-touchbar.mm
@@ -52,7 +52,7 @@ NSButton *tbButton;
 		[tbButton setAction:@selector(actionKey:)];
 		[tbButton setTarget:self];
 
-		[self setButton:nullptr];
+		[self setButton:nil];
 	}
 	return self;
 }
@@ -76,7 +76,7 @@ NSButton *tbButton;
 }
 
 - (void)setButton : (const char *)title {
-	NSString *ns_title = nullptr;
+	NSString *ns_title = nil;
 	if (title) {
 		ns_title = [NSString stringWithUTF8String:title];
 	} else {
@@ -98,7 +98,7 @@ NSButton *tbButton;
 
 @end
 
-static ScummVMlTouchbarDelegate *g_tb_delegate = nullptr;
+static ScummVMlTouchbarDelegate *g_tb_delegate = nil;
 
 void macOSTouchbarUpdate(const char *message) {
 	[g_tb_delegate setButton:message];


Commit: aecd533d3cc516f03cda308c02fb85e8e0c823bf
    https://github.com/scummvm/scummvm/commit/aecd533d3cc516f03cda308c02fb85e8e0c823bf
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-04-29T19:02:59+02:00

Commit Message:
BACKENDS: MACOS: Don't instantiate touch bar on old MacOS versions

They do not support it and it fails on invalidateIntrinsicContentSize
As the touch bar was introduced in 10.12.2, check the SDK version
against this define instead on 10.12.

(cherry picked from commit f67f7f6354a78f714cb504bbb4fc6faa60c66e73)

Changed paths:
    backends/platform/sdl/macosx/macosx-touchbar.mm


diff --git a/backends/platform/sdl/macosx/macosx-touchbar.mm b/backends/platform/sdl/macosx/macosx-touchbar.mm
index bd0ebb1135b..b1136641e6f 100644
--- a/backends/platform/sdl/macosx/macosx-touchbar.mm
+++ b/backends/platform/sdl/macosx/macosx-touchbar.mm
@@ -32,7 +32,7 @@
 #include <Cocoa/Cocoa.h>
 #include <AppKit/NSWorkspace.h>
 
-#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12
+#if defined(MAC_OS_X_VERSION_10_12_2) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12_2
 
 @interface ScummVMlTouchbarDelegate : NSResponder <NSTouchBarDelegate>
 @end
@@ -108,6 +108,9 @@ void macOSTouchbarCreate() {
 	if (g_tb_delegate)
 		return;
 
+	if (NSAppKitVersionNumber < NSAppKitVersionNumber10_12_2)
+		return;
+
 	NSApplication *app = [NSApplication sharedApplication];
 	if (!app)
 		return;




More information about the Scummvm-git-logs mailing list