[Scummvm-git-logs] scummvm master -> 532c112e4cd1f433843af7e449f2ff82c9973b61
lephilousophe
noreply at scummvm.org
Wed Jan 22 18:18:59 UTC 2025
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:
d0909e102d ANDROID: Allocate enough stack
1a4e4c1826 COMMON: Avoid valgrind errors when opening invalid ZIP files
532c112e4c IMAGE: Fix undefined behaviours in Cinepak decoder
Commit: d0909e102d956c65352010ee8094f1b3629c0765
https://github.com/scummvm/scummvm/commit/d0909e102d956c65352010ee8094f1b3629c0765
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-01-22T19:14:15+01:00
Commit Message:
ANDROID: Allocate enough stack
Default stack allocation for Java thread is 1MB which is shared with
Java side.
On a traditional Linux, the main thread is often up to 8MB.
Changed paths:
backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index 9b969bbe9cc..ddea0574aed 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -1058,7 +1058,7 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
_main_surface.setOnHoverListener(_mouseHelper);
}
- _scummvm_thread = new Thread(_scummvm, "ScummVM");
+ _scummvm_thread = new Thread(null, _scummvm, "ScummVM", 8388608); // 8MB
_scummvm_thread.start();
}
Commit: 1a4e4c1826fa79538c723a435d42171eadc65b38
https://github.com/scummvm/scummvm/commit/1a4e4c1826fa79538c723a435d42171eadc65b38
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-01-22T19:14:42+01: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.
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: 532c112e4cd1f433843af7e449f2ff82c9973b61
https://github.com/scummvm/scummvm/commit/532c112e4cd1f433843af7e449f2ff82c9973b61
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-01-22T19:15:58+01: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.
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);
More information about the Scummvm-git-logs
mailing list