aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2010-05-09 18:05:00 +0000
committerEugene Sandulenko2010-05-09 18:05:00 +0000
commitb0f17579c933a20c106c46f25e9f4a646d19e66d (patch)
tree92bb00ed2b6fc6b3f498aa7d6fd4cc84758713cd /engines
parent09a54d765f96c1d6eed8fdbbc42aa3b47fa8f331 (diff)
downloadscummvm-rg350-b0f17579c933a20c106c46f25e9f4a646d19e66d.tar.gz
scummvm-rg350-b0f17579c933a20c106c46f25e9f4a646d19e66d.tar.bz2
scummvm-rg350-b0f17579c933a20c106c46f25e9f4a646d19e66d.zip
Patch #2968610: Zak C64 German: crash due to padding bytes
svn-id: r48981
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/file.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/scumm/file.cpp b/engines/scumm/file.cpp
index 6b68b5d804..0081720d03 100644
--- a/engines/scumm/file.cpp
+++ b/engines/scumm/file.cpp
@@ -431,8 +431,12 @@ uint16 ScummDiskImage::extractResource(Common::WriteStream *out, int res) {
}
for (i = 0; i < _resourcesPerFile[res]; i++) {
- uint16 len = fileReadUint16LE();
- reslen += write_word(out, len);
+ uint16 len;
+ do {
+ // Note: len might be 0xFFFF for padding in zak-c64-german
+ len = fileReadUint16LE();
+ reslen += write_word(out, len);
+ } while (len == 0xFFFF);
for (len -= 2; len > 0; len--)
reslen += write_byte(out, fileReadByte());