[Scummvm-git-logs] scummvm master -> e96a35c34266575be56c043214102eb1ee9ed2cd
mduggan
noreply at scummvm.org
Fri Jun 12 10:50:01 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
e96a35c342 ACCESS: Fix crashes in Noctropolis Demo 2
Commit: e96a35c34266575be56c043214102eb1ee9ed2cd
https://github.com/scummvm/scummvm/commit/e96a35c34266575be56c043214102eb1ee9ed2cd
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2026-06-12T20:49:02+10:00
Commit Message:
ACCESS: Fix crashes in Noctropolis Demo 2
Changed paths:
engines/access/noctropolis/noctropolis_comicviewer.cpp
engines/access/sound.cpp
diff --git a/engines/access/noctropolis/noctropolis_comicviewer.cpp b/engines/access/noctropolis/noctropolis_comicviewer.cpp
index c099bea5a6a..30bc311df63 100644
--- a/engines/access/noctropolis/noctropolis_comicviewer.cpp
+++ b/engines/access/noctropolis/noctropolis_comicviewer.cpp
@@ -72,7 +72,15 @@ void ComicViewer::run(const ComicResource *comic) {
PageResult ComicViewer::runPage(const ComicPage *page) {
PageResult result = kPageResultNone;
- _vm->_files->loadScreen(Common::Path(page->filename));
+ Common::Path pagePath(page->filename);
+
+ if (!_vm->_files->existFile(pagePath)) {
+ // Happens in Demo 2 - no comic files
+ warning("Request to load missing comic page '%s'.", pagePath.toString().c_str());
+ return kPageResultExit;
+ }
+
+ _vm->_files->loadScreen(pagePath);
Resource *bubbleData = _vm->_files->loadRawFile("COMDATA/comic.ap");
_bubbleSprites = new SpriteResource(_vm, bubbleData);
diff --git a/engines/access/sound.cpp b/engines/access/sound.cpp
index b54bb14c776..214cfcf742d 100644
--- a/engines/access/sound.cpp
+++ b/engines/access/sound.cpp
@@ -120,6 +120,12 @@ void SoundManager::playSound(int soundIndex, bool loop /* = false */) {
// Prevent duplicate copies of a sound from being queued
return;
+ if (soundIndex >= (int)_soundTable.size()) {
+ // Happens in Noctropolis demo 2
+ warning("Request to play sound with invalid index %d.", soundIndex);
+ return;
+ }
+
int priority = _soundTable[soundIndex]._priority;
playSound(_soundTable[soundIndex]._res, priority, loop, soundIndex);
}
@@ -249,6 +255,11 @@ void SoundManager::loadSounds(const Common::Array<RoomInfo::SoundIdent> &sounds)
int SoundManager::loadRawSound(const Common::Path &path, int priority) {
debugC(1, kDebugSound, "loadRawSound(%s)", path.toString().c_str());
+ if (!_vm->_files->existFile(path)) {
+ // In Noctropolis demo 2 intro sounds are not included
+ warning("Request to load missing sound file '%s'.", path.toString().c_str());
+ return -1;
+ }
Resource *soundRes = _vm->_files->loadRawFile(path);
_soundTable.push_back(SoundEntry(soundRes, priority));
return _soundTable.size() - 1;
More information about the Scummvm-git-logs
mailing list