mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
SCUMM: Fixed reading malformed resources. Bug #11463
This commit is contained in:
parent
20ebd47f49
commit
1a6ffd6398
@ -653,8 +653,14 @@ int ScummEngine::loadResource(ResType type, ResId idx) {
|
||||
if ((_game.version == 3) && !(_game.platform == Common::kPlatformAmiga) && (type == rtSound)) {
|
||||
return readSoundResourceSmallHeader(idx);
|
||||
} else {
|
||||
size = _fileHandle->readUint16LE();
|
||||
_fileHandle->seek(-2, SEEK_CUR);
|
||||
// WORKAROUND: Apple //gs MM has malformed sound resource #68
|
||||
if (_fileHandle->pos() + 2 > _fileHandle->size()) {
|
||||
warning("loadResource(%s,%d): resource is too short", nameOfResType(type), idx);
|
||||
size = 0;
|
||||
} else {
|
||||
size = _fileHandle->readUint16LE();
|
||||
_fileHandle->seek(-2, SEEK_CUR);
|
||||
}
|
||||
}
|
||||
} else if (_game.features & GF_SMALL_HEADER) {
|
||||
if (_game.version == 4)
|
||||
|
Loading…
x
Reference in New Issue
Block a user