[Scummvm-git-logs] scummvm master -> 91d6bc1106ca08210634b1cc952df8d0aab558a2
antoniou79
noreply at scummvm.org
Sun Dec 8 17:52:56 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
91d6bc1106 BLADERUNNER: Use assert for failed malloc for thumbnail data
Commit: 91d6bc1106ca08210634b1cc952df8d0aab558a2
https://github.com/scummvm/scummvm/commit/91d6bc1106ca08210634b1cc952df8d0aab558a2
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2024-12-08T19:51:47+02:00
Commit Message:
BLADERUNNER: Use assert for failed malloc for thumbnail data
Instead of check for nullptr
Changed paths:
engines/bladerunner/savefile.cpp
diff --git a/engines/bladerunner/savefile.cpp b/engines/bladerunner/savefile.cpp
index d01c8220a31..392bb5a8fcb 100644
--- a/engines/bladerunner/savefile.cpp
+++ b/engines/bladerunner/savefile.cpp
@@ -154,13 +154,13 @@ bool SaveFileManager::readHeader(Common::SeekableReadStream &in, SaveFileHeader
} else {
uint16 alphamask = (0xFF >> gameDataPixelFormat().aLoss) << gameDataPixelFormat().aShift;
uint16 *thumbnailData = (uint16*)malloc(kThumbnailSize); // freed by ScummVM's smartptr
- if (thumbnailData) {
- for (uint i = 0; i < kThumbnailSize / 2; ++i) {
- thumbnailData[i] = s.readUint16LE() | alphamask; // We set all pixels to non-transparency
- }
- header._thumbnail = new Graphics::Surface();
- header._thumbnail->init(80, 60, 160, thumbnailData, gameDataPixelFormat());
+ assert(thumbnailData);
+
+ for (uint i = 0; i < kThumbnailSize / 2; ++i) {
+ thumbnailData[i] = s.readUint16LE() | alphamask; // We set all pixels to non-transparency
}
+ header._thumbnail = new Graphics::Surface();
+ header._thumbnail->init(80, 60, 160, thumbnailData, gameDataPixelFormat());
}
s.seek(pos);
More information about the Scummvm-git-logs
mailing list