[Scummvm-git-logs] scummvm master -> 73c06d2850cd76b49706d62031a5142af60dac3f
AndywinXp
noreply at scummvm.org
Sun Jan 21 09:44:16 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:
2e3ede7d58 SCUMM: Fix crash when missing TRS file in Full Throttle
73c06d2850 SCUMM: Warnings for possibly missing subtitle files
Commit: 2e3ede7d5800979e835b414c648721cda64fab34
https://github.com/scummvm/scummvm/commit/2e3ede7d5800979e835b414c648721cda64fab34
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2024-01-21T10:44:11+01:00
Commit Message:
SCUMM: Fix crash when missing TRS file in Full Throttle
This was inspired by bug report https://bugs.scummvm.org/ticket/14876
It is a naive fix, whereby I've added checks for nullptr where Visual Studio debugging
would crash with exception, due to trying to access a nullptr pointer.
It works for the specific crash case, but someone more familiar with the engines should review it.
The crash itself seems to be caused by the game data folder missing
the resource file for subtitles in that scene (which I think is the "DATA\MINEROAD.TRS").
Changed paths:
engines/scumm/insane/insane.cpp
engines/scumm/smush/smush_player.cpp
diff --git a/engines/scumm/insane/insane.cpp b/engines/scumm/insane/insane.cpp
index cf9bfe85a29..356add8ad6f 100644
--- a/engines/scumm/insane/insane.cpp
+++ b/engines/scumm/insane/insane.cpp
@@ -1383,7 +1383,9 @@ void Insane::smlayer_setActorFacing(int actornum, int actnum, int frame, int dir
const char *Insane::handleTrsTag(int32 trsId) {
debugC(DEBUG_INSANE, "Insane::handleTrsTag(%d)", trsId);
- return _player->getString(trsId);
+ if (_player != nullptr) {
+ return _player->getString(trsId);
+ } else return nullptr;
}
bool Insane::smush_eitherNotStartNewFrame() {
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 211c6801f23..7af9db97d21 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -669,7 +669,9 @@ void SmushPlayer::handleTextResource(uint32 subType, int32 subSize, Common::Seek
}
const char *SmushPlayer::getString(int id) {
- return _strings->get(id);
+ if (_strings != nullptr) {
+ return _strings->get(id);
+ } else return nullptr;
}
bool SmushPlayer::readString(const char *file) {
Commit: 73c06d2850cd76b49706d62031a5142af60dac3f
https://github.com/scummvm/scummvm/commit/73c06d2850cd76b49706d62031a5142af60dac3f
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2024-01-21T10:44:11+01:00
Commit Message:
SCUMM: Warnings for possibly missing subtitle files
Changed paths:
engines/scumm/insane/insane.cpp
engines/scumm/smush/smush_player.cpp
diff --git a/engines/scumm/insane/insane.cpp b/engines/scumm/insane/insane.cpp
index 356add8ad6f..514d06d6647 100644
--- a/engines/scumm/insane/insane.cpp
+++ b/engines/scumm/insane/insane.cpp
@@ -1385,7 +1385,10 @@ const char *Insane::handleTrsTag(int32 trsId) {
debugC(DEBUG_INSANE, "Insane::handleTrsTag(%d)", trsId);
if (_player != nullptr) {
return _player->getString(trsId);
- } else return nullptr;
+ } else {
+ warning("Couldn't load Trs block corresponding to id {%d}, are you maybe missing a TRS subtitle file?", trsId);
+ return nullptr;
+ }
}
bool Insane::smush_eitherNotStartNewFrame() {
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 7af9db97d21..f0a978ba3c9 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -671,7 +671,10 @@ void SmushPlayer::handleTextResource(uint32 subType, int32 subSize, Common::Seek
const char *SmushPlayer::getString(int id) {
if (_strings != nullptr) {
return _strings->get(id);
- } else return nullptr;
+ } else {
+ warning("Couldn't load string with id {%d}, are you maybe missing a TRS subtitle file?", id);
+ return nullptr;
+ }
}
bool SmushPlayer::readString(const char *file) {
More information about the Scummvm-git-logs
mailing list