aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Milburn2011-07-02 00:11:44 +0200
committerAlyssa Milburn2011-07-02 00:11:44 +0200
commitd2035b34e0a6b829737e65e8cc382924b7d356fc (patch)
tree78296c1c1c3323e7dfd99ea371977b131117a0fc
parent2667b502d790c640e0f6a71b21857333134b9a41 (diff)
downloadscummvm-rg350-d2035b34e0a6b829737e65e8cc382924b7d356fc.tar.gz
scummvm-rg350-d2035b34e0a6b829737e65e8cc382924b7d356fc.tar.bz2
scummvm-rg350-d2035b34e0a6b829737e65e8cc382924b7d356fc.zip
MOHAWK: Allow creation of LBCode instances without an associated BCOD.
-rw-r--r--engines/mohawk/livingbooks_code.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index d091f95a15..0aaedfe274 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -127,6 +127,12 @@ Common::Rect LBValue::toRect() const {
}
LBCode::LBCode(MohawkEngine_LivingBooks *vm, uint16 baseId) : _vm(vm) {
+ if (!baseId) {
+ _data = new byte[0];
+ _size = 0;
+ return;
+ }
+
Common::SeekableSubReadStreamEndian *bcodStream = _vm->wrapStreamEndian(ID_BCOD, baseId);
uint32 totalSize = bcodStream->readUint32();