From d2035b34e0a6b829737e65e8cc382924b7d356fc Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Sat, 2 Jul 2011 00:11:44 +0200 Subject: MOHAWK: Allow creation of LBCode instances without an associated BCOD. --- engines/mohawk/livingbooks_code.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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(); -- cgit v1.2.3