[Scummvm-git-logs] scummvm master -> e8ca26f6bed7b4bb381db2ded84dd4035a51279c
sev-
noreply at scummvm.org
Mon Nov 11 00:00:45 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:
93ffa28ffe COMMON: Process gracefully when unarj cannot unpack into memory
e8ca26f6be DRASCULA: Do not crash when there is not enough memory for cutscenes. Bug #15193
Commit: 93ffa28ffee619145dcbd3fefd449e54d2e363f9
https://github.com/scummvm/scummvm/commit/93ffa28ffee619145dcbd3fefd449e54d2e363f9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-11-11T01:00:19+01:00
Commit Message:
COMMON: Process gracefully when unarj cannot unpack into memory
Changed paths:
common/compression/unarj.cpp
diff --git a/common/compression/unarj.cpp b/common/compression/unarj.cpp
index 007f4018a15..e253f6b199c 100644
--- a/common/compression/unarj.cpp
+++ b/common/compression/unarj.cpp
@@ -822,6 +822,11 @@ Common::SharedArchiveContents ArjArchive::readContentsForPath(const Common::Path
byte *uncompressedData = new byte[uncompressedSize];
uint32 uncompressedPtr = 0;
+ if (!uncompressedData) {
+ warning("ArjArchive: Failed to allocate %d bytes", (uint32)uncompressedSize);
+ return Common::SharedArchiveContents();
+ }
+
for (uint chunk = 0; chunk < totalChunks; chunk++) {
File archiveFile;
ArjHeader *hdr = hdrs[chunk]._header;
Commit: e8ca26f6bed7b4bb381db2ded84dd4035a51279c
https://github.com/scummvm/scummvm/commit/e8ca26f6bed7b4bb381db2ded84dd4035a51279c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-11-11T01:00:19+01:00
Commit Message:
DRASCULA: Do not crash when there is not enough memory for cutscenes. Bug #15193
At least now the game is possible to play. There is unfortunately no
easy way to make our Arj unpacker streamable.
Changed paths:
engines/drascula/graphics.cpp
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp
index 69c1de86e47..a3d5e872fa9 100644
--- a/engines/drascula/graphics.cpp
+++ b/engines/drascula/graphics.cpp
@@ -551,6 +551,11 @@ void DrasculaEngine::playFLI(const char *filefli, int vel) {
globalSpeed = 1000 / vel;
FrameSSN = 0;
Common::SeekableReadStream *stream = _archives.open(filefli);
+
+ if (!stream) {
+ warning("playFLI: Failed to load file '%s'", filefli);
+ return;
+ }
LastFrame = _system->getMillis();
while (playFrameSSN(stream) && (!term_int) && !shouldQuit()) {
@@ -699,7 +704,8 @@ bool DrasculaEngine::animate(const char *animationFile, int FPS) {
Common::SeekableReadStream *stream = _archives.open(animationFile);
if (!stream) {
- error("Animation file %s not found", animationFile);
+ warning("Animation file %s not found", animationFile);
+ return true;
}
NFrames = stream->readSint32LE();
More information about the Scummvm-git-logs
mailing list