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

elasota noreply at scummvm.org
Sun Jun 26 19:14:46 UTC 2022


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:
aa9b9f5ce9 MTROPOLIS: Fix crash on Immediate Action clock puzzle


Commit: aa9b9f5ce91b7bbe73f4b1c3965bed53b027d078
    https://github.com/scummvm/scummvm/commit/aa9b9f5ce91b7bbe73f4b1c3965bed53b027d078
Author: elasota (ejlasota at gmail.com)
Date: 2022-06-26T15:14:04-04:00

Commit Message:
MTROPOLIS: Fix crash on Immediate Action clock puzzle

Changed paths:
    engines/mtropolis/assets.cpp
    engines/mtropolis/data.h


diff --git a/engines/mtropolis/assets.cpp b/engines/mtropolis/assets.cpp
index a64f5cb7665..b2a4733322e 100644
--- a/engines/mtropolis/assets.cpp
+++ b/engines/mtropolis/assets.cpp
@@ -436,16 +436,12 @@ void CachedMToon::loadUncompressedFrame(const Common::Array<uint8> &data, size_t
 void CachedMToon::decompressQuickTimeFrame(const Common::Array<uint8> &data, size_t frameIndex) {
 	const MToonMetadata::FrameDef &frameDef = _metadata->frames[frameIndex];
 
-	uint16 bpp = _metadata->bitsPerPixel;
-	size_t w = frameDef.rect.width();
-	size_t h = frameDef.rect.height();
-
-	if (_metadata->codecData.size() < 86) {
-		error("Unknown codec data block size");
-	}
-	if (READ_BE_UINT16(&_metadata->codecData[32]) != w || READ_BE_UINT16(&_metadata->codecData[34]) != h || READ_BE_UINT16(&_metadata->codecData[82]) != bpp) {
-		error("Codec data block didn't match mToon metadata");
-	}
+	// We used to validate that these match the sample desc, but that actually breaks in Obsidian
+	// on the Bureau Immediate Action clock puzzle, because the frames have different sizes and
+	// the codec data encodes the size of the last frame.
+	uint16 w = frameDef.rect.width();
+	uint16 h = frameDef.rect.height();
+	uint16 bpp = READ_BE_UINT16(&_metadata->codecData[82]);
 
 	Image::Codec *codec = Image::createQuickTimeCodec(_metadata->codecID, w, h, bpp);
 	if (!codec) {
diff --git a/engines/mtropolis/data.h b/engines/mtropolis/data.h
index 896d430ec16..d050745cc30 100644
--- a/engines/mtropolis/data.h
+++ b/engines/mtropolis/data.h
@@ -1694,6 +1694,9 @@ struct MToonAsset : public DataObject {
 	Common::Array<FrameDef> frames;
 
 	// Codec data appears to be a 16-byte header followed by a QuickTime sample description
+	// Note that the sample description is partly useless because frames can have different sizes
+	// and the sample desc is only for the last frame!
+	//
 	// The 16-byte header is:
 	// uint32be size of codec data
 	// char[4] codec ID




More information about the Scummvm-git-logs mailing list