mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-01 14:21:41 +00:00
SCI: Fix bug #12808 - restore the behavior of seek() in SCI
With the latest changes to savegame streams, seeking to a location past the end of a file results in an assert. Restore the previous behavior, where the file pointer seeks to the maximum available file location.
This commit is contained in:
parent
994ac18c52
commit
4241d3fae4
@ -773,6 +773,7 @@ reg_t kFileIOSeek(EngineState *s, int argc, reg_t *argv) {
|
||||
FileHandle *f = getFileFromHandle(s, handle);
|
||||
|
||||
if (f && f->_in) {
|
||||
offset = MIN<int16>(offset, f->_in->size());
|
||||
const bool success = f->_in->seek(offset, whence);
|
||||
if (getSciVersion() >= SCI_VERSION_2) {
|
||||
if (success) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user