[Scummvm-git-logs] scummvm master -> 176430f3db4dd23a54f314ef0843ed38ba6edc73
bluegr
noreply at scummvm.org
Wed Oct 30 16:08:32 UTC 2024
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:
815141fdf6 AGS: Define AGS_STRICT_ALIGNMENT for SCUMM_NEED_ALIGNMENT builds
176430f3db AGS: Fix lzwexpand on strict-alignment platforms
Commit: 815141fdf61e02d6ff84aec6c0ff2f527c888cd7
https://github.com/scummvm/scummvm/commit/815141fdf61e02d6ff84aec6c0ff2f527c888cd7
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2024-10-30T18:08:29+02:00
Commit Message:
AGS: Define AGS_STRICT_ALIGNMENT for SCUMM_NEED_ALIGNMENT builds
Otherwise, the safety measures for strict-alignment platforms weren't
enabled in shared/util/memory.h.
Changed paths:
engines/ags/shared/core/platform.h
diff --git a/engines/ags/shared/core/platform.h b/engines/ags/shared/core/platform.h
index 2f14e94ef03..e1e2f92c4a9 100644
--- a/engines/ags/shared/core/platform.h
+++ b/engines/ags/shared/core/platform.h
@@ -134,6 +134,10 @@ namespace AGS3 {
#error "No endianness defined"
#endif
+#if defined(SCUMM_NEED_ALIGNMENT)
+#define AGS_STRICT_ALIGNMENT
+#endif
+
#define AGS_PLATFORM_DESKTOP ((AGS_PLATFORM_OS_WINDOWS) || (AGS_PLATFORM_OS_LINUX) || (AGS_PLATFORM_OS_MACOS))
#define AGS_PLATFORM_MOBILE ((AGS_PLATFORM_OS_ANDROID) || (AGS_PLATFORM_OS_IOS))
Commit: 176430f3db4dd23a54f314ef0843ed38ba6edc73
https://github.com/scummvm/scummvm/commit/176430f3db4dd23a54f314ef0843ed38ba6edc73
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2024-10-30T18:08:29+02:00
Commit Message:
AGS: Fix lzwexpand on strict-alignment platforms
Fixes TRAC #15179, where starting Maniac Mansion Deluxe on mips64el would
trigger a SIGBUS. Also caught by UBSan.
Changed paths:
engines/ags/shared/util/lzw.cpp
diff --git a/engines/ags/shared/util/lzw.cpp b/engines/ags/shared/util/lzw.cpp
index ef6a6c9823e..902330b83cf 100644
--- a/engines/ags/shared/util/lzw.cpp
+++ b/engines/ags/shared/util/lzw.cpp
@@ -28,6 +28,7 @@
#include "ags/shared/util/lzw.h"
#include "ags/shared/ac/common.h" // quit
#include "ags/shared/util/bbop.h"
+#include "ags/shared/util/memory.h"
#include "ags/shared/util/stream.h"
#include "ags/globals.h"
@@ -222,7 +223,7 @@ bool lzwexpand(const uint8_t *src, size_t src_sz, uint8_t *dst, size_t dst_sz) {
break;
short jshort = 0;
- jshort = BBOp::Int16FromLE(*(reinterpret_cast<const int16_t *>(src_ptr)));
+ jshort = Memory::ReadInt16LE(src_ptr);
src_ptr += sizeof(int16_t);
j = jshort;
More information about the Scummvm-git-logs
mailing list