diff options
author | Kirben | 2014-03-06 15:06:54 +1100 |
---|---|---|
committer | Kirben | 2014-03-06 15:06:54 +1100 |
commit | a310feb8a562ddce2a45f4ae1b5b46206cdda692 (patch) | |
tree | e425d8f6541e0cac96d755b39c92ded08e593ac5 | |
parent | eddf87f5485a80cfd1d83f477bb258a5ad399b95 (diff) | |
download | scummvm-rg350-a310feb8a562ddce2a45f4ae1b5b46206cdda692.tar.gz scummvm-rg350-a310feb8a562ddce2a45f4ae1b5b46206cdda692.tar.bz2 scummvm-rg350-a310feb8a562ddce2a45f4ae1b5b46206cdda692.zip |
AGOS: Fix error when dumping all VGA scripts.
-rw-r--r-- | engines/agos/res.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp index 4d91d1a8e1..2631f7998e 100644 --- a/engines/agos/res.cpp +++ b/engines/agos/res.cpp @@ -802,7 +802,6 @@ void AGOSEngine::loadVGABeardFile(uint16 id) { } } else { offs = _gameOffsetsPtr[id]; - size = _gameOffsetsPtr[id + 1] - offs; readGameFile(_vgaBufferPointers[11].vgaFile2, offs, size); } @@ -911,8 +910,16 @@ void AGOSEngine::loadVGAVideoFile(uint16 id, uint8 type, bool useError) { } else { id = id * 2 + (type - 1); offs = _gameOffsetsPtr[id]; - dstSize = _gameOffsetsPtr[id + 1] - offs; + + if (!dstSize) { + if (useError) + error("loadVGAVideoFile: Can't load id %d type %d", id, type); + + _block = _blockEnd = NULL; + return; + } + dst = allocBlock(dstSize + extraBuffer); readGameFile(dst, offs, dstSize); } |