Patch #2968610: Zak C64 German: crash due to padding bytes

svn-id: r48981
This commit is contained in:
Eugene Sandulenko 2010-05-09 18:05:00 +00:00
parent 09a54d765f
commit b0f17579c9

View File

@ -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());