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

bluegr noreply at scummvm.org
Thu Apr 23 00:42:07 UTC 2026


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

Summary:
46402b875d MADS: PHANTOM: Add a sanity check for sound channel buffers
b0003a09ea MADS: PHANTOM: Ensure that there's enough heap allocated for dialogs


Commit: 46402b875d2ec692669cb4aefedb01ccabecc76f
    https://github.com/scummvm/scummvm/commit/46402b875d2ec692669cb4aefedb01ccabecc76f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-04-23T03:41:37+03:00

Commit Message:
MADS: PHANTOM: Add a sanity check for sound channel buffers

The game occasionally frees up sound channel data and then tries to
access the freed buffer. Add a sanity check for that case, to avoid
crashing

Changed paths:
    engines/mads/core/sound.cpp


diff --git a/engines/mads/core/sound.cpp b/engines/mads/core/sound.cpp
index 3cae76883f8..78a1013889e 100644
--- a/engines/mads/core/sound.cpp
+++ b/engines/mads/core/sound.cpp
@@ -542,7 +542,7 @@ void ASound::pollActiveChannel() {
 		if (--_activeChannelPtr->_activeCount <= 0) {
 			for (;;) {
 				byte *pSrc = chan->_pSrc;
-				if (!chan->_ptr1) {
+				if (!chan->_ptr1 || !pSrc) {
 					warning("pollActiveChannel(): No data found for sound channel");
 					break;
 				}


Commit: b0003a09ea2f132063d0c555a7c3c1daff6c7e3d
    https://github.com/scummvm/scummvm/commit/b0003a09ea2f132063d0c555a7c3c1daff6c7e3d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-04-23T03:41:38+03:00

Commit Message:
MADS: PHANTOM: Ensure that there's enough heap allocated for dialogs

This avoids crashing with an out of heap error when accessing the game
menu

Changed paths:
    engines/mads/madsv2/core/game.h


diff --git a/engines/mads/madsv2/core/game.h b/engines/mads/madsv2/core/game.h
index 1bbe1daa1ed..572f713e912 100644
--- a/engines/mads/madsv2/core/game.h
+++ b/engines/mads/madsv2/core/game.h
@@ -138,7 +138,7 @@ enum {
 #define GAME_MAX_SAVES_ON_SCREEN 7    /* Max saves on screen at once */
 
 #define GAME_SAVE_SLOT_MEMORY   (GAME_MAX_SAVE_SLOTS * (GAME_MAX_SAVE_LENGTH + 1))
-#define GAME_DIALOG_HEAP        4096
+#define GAME_DIALOG_HEAP        (4096 + sizeof(PopupItem) * GAME_MENU_MAX_ITEMS)
 #define GAME_FUDGE_FACTOR       256
 #define GAME_MENU_HEAP          (GAME_SAVE_SLOT_MEMORY + GAME_DIALOG_HEAP + GAME_FUDGE_FACTOR)
 




More information about the Scummvm-git-logs mailing list